Created
October 24, 2013 00:07
-
-
Save jazbek/7129020 to your computer and use it in GitHub Desktop.
Order events by their post date
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
| <?php | |
| add_action( 'pre_get_posts', 'tribe_post_date_ordering', 51 ); | |
| function tribe_post_date_ordering( $query ) { | |
| if ( $query->tribe_is_multi_posttype) { | |
| remove_filter( 'posts_fields', array( 'TribeEventsQuery', 'multi_type_posts_fields' ) ); | |
| $query->set( 'order', 'DESC' ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should be the default behavior, clearly the blog roll reflects the date things are written. The original code just makes a mess of the blog, using future dates for coming events instead of post dates.
Any chance to just fix the issue? functions.php is fragile, child theme of the theme in use less fragile. Unless you change the theme... then the fix is lost again! Can we not just fix the plugin?