Skip to content

Instantly share code, notes, and snippets.

@barryhughes
Created April 7, 2015 23:45
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 barryhughes/21a387de59c518bb890f to your computer and use it in GitHub Desktop.
Save barryhughes/21a387de59c518bb890f to your computer and use it in GitHub Desktop.
Show all events past, present and future in photo view (TEC/ECP 3.9.x)
add_action( 'tribe_events_pre_get_posts', 'show_all_in_photo_view' );
function show_all_in_photo_view( $query ) {
// Only modify the main query
if ( ! $query->is_main_query() ) return;
// Only modify photo view (comment out or delete the following
// line to remove this restriction)
if ( 'photo' !== $query->get( 'eventDisplay' ) ) return;
// Show all events
$query->set( 'posts_per_page', -1 );
$query->set( 'start_date', '1000-01-01' );
$query->set( 'end_date', '5000-01-01' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment