Skip to content

Instantly share code, notes, and snippets.

@jazbek
Created October 24, 2013 00:07
Show Gist options
  • Select an option

  • Save jazbek/7129020 to your computer and use it in GitHub Desktop.

Select an option

Save jazbek/7129020 to your computer and use it in GitHub Desktop.
Order events by their post date
<?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' );
}
}
@artiescie
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment