If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #13825

    Hello, I need help: How can I change the sorting of portfolio items?

    I need a random order.



    Open up functions.php and add following code to the bottom of the file:

    function loop_portfolio_query( $location )
    if ( $location == 'loop-portfolio' )
    global $avia_config;
    if(isset($avia_config['new_query'])) {
    $avia_config['new_query']['orderby'] = "rand";
    add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );


    Hi Dude, thanks for the function.

    I pasted it in the file but every time I load the page (start page with some images from portfolio, or the portfolio page) I get the same pics in the same order.



    The snippet above should work. Try to remove browser histroy then refresh the page. You will notice that the portfolio entries will change order every page load.




    Hello, I deactivated the “post types order”-plugin and now it works.

    Supadupa! Thanks for your help.



    Just a hint – the pro version of the post types order plugin allows you to exclude queries with an orderby parameter.



Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Flagship Portfolio in random order’ is closed to new replies.