Skip to content

Instantly share code, notes, and snippets.

@baerkins
Created December 2, 2014 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baerkins/3379726428ff28da8e5b to your computer and use it in GitHub Desktop.
Save baerkins/3379726428ff28da8e5b to your computer and use it in GitHub Desktop.
Reverse order of Past Events in Tribe Events Calendar via https://gist.github.com/elimn/0be6c4cbcf80b3721c81
<?php
function tribe_past_reverse_chronological ($post_object) {
$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'past') ? true : false;
if(tribe_is_past() || $past_ajax) {
$post_object = array_reverse($post_object);
}
return $post_object;
}
add_filter('the_posts', 'tribe_past_reverse_chronological', 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment