Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #22614

    You really should support the Page Attributes / Order field for portfolio items. Or at least default to date descending.

    Why in the world would you assume that you want all of the earliest entries to appear first? By ID, no less?

    #116404

    Hi,

    You can add this at the bottom of functions.php to sort the portfolio items.

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

    You can replace DESC to ASC. Please refer to this link https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters.

    Regards,

    Ismael

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

The topic ‘Portfolio Item Sort Order’ is closed to new replies.