Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1400278

    Hi,

    I want to have the portfolio items sorted randomly in portfolio grid on every page load. I added this code to functions.php.

    function custom_post_grid_query($query)
    {
      $query['orderby'] = 'rand';
      return $query;
    }
    add_filter('avia_post_grid_query','custom_post_grid_query');

    Problem: when I go to page 2 of portfolio grid there is a new mix of portfolio items. It can happen that I don’t see a single portfolio item, because on first reload it is on page 2 and on the second reload ist is on page 1.

  • https://berliner-podencos.de
  • Is there a way to change the sort order randomly on reload of home page (location of portfolio grid), but not when switching from page one to page two (or 3 or 4)? So only on first reload, but until I reload the home page again every switch should not change the sort order so that I have the chance to see all portfolio items.

    Best regards,
    Tom

#1400709

Hey Tom,

I’m afraid that’s not easily possible. If this is something important for you, please consider to hire a freelancer for the task.

Best regards,
Yigit

#1400812

Hey Yigit,

thanks a lot for your message. It’s not important as it is a web site for hobbyists, but it would have been a nice to have. So we will use the random sort order, but not the pagination.

Best regards,
Tom

#1400828

Hi,
Glad Yigit could clarify this and you are able to work around it, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

Best regards,
Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Randomly sort order of portfolio items in portfolio grid and pagination’ is closed to new replies.