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

    Hi there,
    I’m using Flagship and my client has asked that on the front page for the portfolio items to be randomised.

    I found the code as suggested in another thread which worked great – until I added multiple portfolio catergories – at that point it went back to alphabetical sorting.
    Is there a way to fix this?

    Thanks in advance!

    #169510

    Hi henryscat666!

    Try adding this code to your functions.php file:

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

    Cheers!
    Josue

    #169512

    If I wasn’t married already, I’d have your babies!
    Thanks very much dude!

    #169514

    Hehe, glad we could help, let us know if you have any more questions or issues :)

    Regards,
    
Josue

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

The topic ‘Portfolio random order – multiple categories’ is closed to new replies.