-
-
Save theeventscalendar/377cf42e340c348265d4 to your computer and use it in GitHub Desktop.
Orders events in your main blog loop by the event publish date instead of the event date.
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', 'tribe_post_date_ordering', 51 ); | |
function tribe_post_date_ordering( $query ) { | |
if ( ! empty( $query->tribe_is_multi_posttype ) ) { | |
remove_filter( 'posts_fields', array( 'Tribe__Events__Query', '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