Created
June 29, 2012 04:36
-
-
Save claudiosanches/3015790 to your computer and use it in GitHub Desktop.
Order post by modified date - Wordpress
This file contains hidden or 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
// Order post by modified date | |
function dfw_query_orderby_modified($query) { | |
if (is_home() || is_home() && is_paged()) { | |
$query->query_vars['orderby'] = 'modified'; | |
return; | |
} | |
} | |
add_filter('pre_get_posts', 'dfw_query_orderby_modified'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment