Created
April 7, 2015 23:45
-
-
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)
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( '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