Last active
August 29, 2015 14:08
-
-
Save geoffgraham/d9f4428d09f70daa2ff4 to your computer and use it in GitHub Desktop.
The Events Calendar - Order Events by Modified Date when on Home
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
add_action( 'pre_get_posts', 'order_by_modified' ); | |
function order_by_modified( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->set( 'orderby', 'modified' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment