• Anna
    May 1, 2015 at 7:55 am #107640

    In wordpress there are 2 order situations by date:

    – first publish date

    – edit publish date

    We use order by first publish date and edit date is not considered.

    So default order will consider the first publish date.

    The technical solution is to modify the query orderby, but it’s sensitive so we will keep this idea on hold for now for core.

    But if you wish, I can guide you to look for the following function that controls this custom query – wpestate_my_order and then modify it according to WordPress query rules – http://codex.wordpress.org/Class_Reference/WP_Query

    What you need is

    orderby (string | array)

    • modified‘ – Order by last modified date.

    Query is set in WP ESTATE in functions.php

    See this code

    /////////////////////////////////////////////////////////////////////////////////
    
    // order by filter featured
    
    ///////////////////////////////////////////////////////////////////////////////////
    
    function my_order($orderby) {
    
    global $wpdb;
    
    global $table_prefix;
    
    $orderby = $table_prefix.'postmeta.meta_value DESC, '.$table_prefix.'posts.ID DESC';
    
    return $orderby;
    
    } 


    Query is set in WP Rsidence in help_functions.php

    /////////////////////////////////////////////////////////////////////////////////
    // order by filter featured
    ///////////////////////////////////////////////////////////////////////////////////
    
    if( !function_exists('wpestate_my_order') ):
    function wpestate_my_order($orderby) { 
        global $wpdb; 
        global $table_prefix;
        $orderby = $table_prefix.'postmeta.meta_value DESC, '.$table_prefix.'posts.ID DESC';
        return $orderby;
    }    
    
    endif; // end   wpestate_my_order  


    Thank you

You must be logged in to reply to this topic.

'
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.