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

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

    I need a random order.

    thanks

    #80774

    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";
    query_posts($avia_config['new_query']);
    }
    }
    }
    add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );

    #80775

    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.

    #80776

    Hello,

    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.

    Regards,

    Ismael

    #80777

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

    Supadupa! Thanks for your help.

    #80778

    Hi!

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

    Regards,

    Peter

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

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