Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #261533

    Is there a way to set random order for portfolio post on home page?
    Right now is ascending order but I would like to random order so every visit to home page there will be a different portfolio posts.

    #261953
    #262047

    Yigit, thank you for respond but this do not work for corona theme.
    Something other?

    #263658

    Hey!

    Please add following code to bottom of Functions.php file in Appearance > Editor

    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 );

    Regards,
    Yigit

    #263671

    Yigit,

    I inserted code from yours last post but nothing changed.

    URL

    #264505

    Hey!

    Please open up wp-content/themes/corona/includes/loop-portfolio.php and replace:

    
    if(isset($avia_config['new_query'])) { query_posts($avia_config['new_query']); }
    

    with

    
    if(isset($avia_config['new_query'])) {
    $avia_config['new_query']['orderby'] = "rand";
    query_posts($avia_config['new_query']);
    }
    

    Regards,
    Peter

    #264591

    Thank you Peter, it works! :)

    Great support!

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

The topic ‘Portfolio posts order on home page’ is closed to new replies.