Created
May 12, 2015 10:18
-
-
Save Kaiderella/6f63921c02c6a45bf67a to your computer and use it in GitHub Desktop.
Sắp xếp bài viết theo ngày cập nhật
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
function order_posts_by_mod_date($orderby) { | |
if (is_home() || is_archive() || is_feed()) { | |
$orderby = "post_modified_gmt DESC"; | |
} | |
return $orderby; | |
} | |
add_filter('posts_orderby', 'order_posts_by_mod_date', 999); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment