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

    Hi there,

    I am trying to get my portfolio items sorted by published date but I can’t get it to work.

    I’ve tried using this code in my child theme functions.php, but it’s not working:

    /* Portfolio sorting order */
    function loop_portfolio_query( $location )
    if ( $location == ‘loop-portfolio’ )
    global $avia_config;
    $avia_config[‘new_query’][‘orderby’] = “date”;
    $avia_config[‘new_query’][‘orderby’] = “DESC”;
    add_action( ‘avia_action_query_check’ , ‘loop_portfolio_query’, 10, 1 );

    When I replace ‘date’ with ‘rand’ it DOES show a random order each time I reload the page, so it must be something obvious I am overlooking.

    Thanks for helping out!


    Hi Digit,

    thanks for the quick response. I added the code but I do not see the new ‘orderly’ settings in the Flagship Theme Options > Portfolio. Is this update for Flagship or only for Enfold?



    Hi Yigit,

    any update to my question above?




    The default sorting of the portfolio items or posts is by date so you don’t have to add the query. Did you install the post type order plugin? Please remove it then try this code:

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

    Best regards,


    Hi Ismael,

    that worked, thanks a lot!!

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

The topic ‘Portfolio sorting by publish date not working’ is closed to new replies.