Created
March 22, 2017 07:30
-
-
Save Kaiderella/72d568c44463bb7768c2e61b07c4a72e to your computer and use it in GitHub Desktop.
Sắp xếp danh sách bài viết theo ngày chỉnh sửa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Re-order posts list | |
function orderby_modified_posts( $query ) { | |
if ($query->is_main_query()) { | |
$query->set( 'orderby', 'modified' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'orderby_modified_posts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment