Tribe Events has a way to display all events ( past, present, future ) on your main listing page. It defaults to only showing upcoming events, but sometimes you might want to list them all. To list them all in chronological order:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | // Changes past event views to reverse chronological order add_filter(‘the_posts’, ‘tribe_past_reverse_chronological’, 100); function tribe_past_reverse_chronological ($post_object) { $past_ajax = (defined( ‘DOING_AJAX’ ) && DOING_AJAX && $_REQUEST[‘tribe_event_display’] === ‘past’) ? true : false; if(tribe_is_list_view() || $past_ajax) { $post_object = array_reverse($post_object); } return $post_object; } // show all events for list view function tribe_set_default_date( $wp_query ) { if ( ! tribe_is_event_query() || ! $wp_query->is_main_query() || $wp_query->get( ‘eventDate’ ) != ‘’) return; if(tribe_is_list_view()) { $wp_query->set(‘eventDate’, ‘2000-01-01’); } } if(function_exists(‘tribe_is_event_query’)) { add_action( ‘parse_query’, ‘tribe_set_default_date’, 100); } |