• Resolved anefarious1

    (@anefarious1)


    Is there any way to make the plugin sort the post list column in a certain way (for example: from oldest to newest) by default?

    I think now you have to click on the column title – sometimes twice before it will sort in the desired way. Any setting for that? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sayan Datta

    (@infosatech)

    Hi, it is possible. Just add this snippet to the end of your functions.php file.

    function orderby_modified_posts( $query ) {
        if( is_admin() ) {
    	$query->set( 'orderby', 'modified' );
            $query->set( 'order', 'asc' );
        }
    }
    add_action( 'pre_get_posts', 'orderby_modified_posts' );

    Thanks

    Thread Starter anefarious1

    (@anefarious1)

    That worked! Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Default Sorting of Post List Column in Backend’ is closed to new replies.