Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ooobo/2977431 to your computer and use it in GitHub Desktop.
Save ooobo/2977431 to your computer and use it in GitHub Desktop.
The Events Calendar: Basic Conditional Wrappers
add_action( 'wp_print_styles', 'deregister_styles', 100 );
function deregister_styles() {
if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages
} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List
} elseif( tribe_is_event() && is_single() ) { // Single Events
} elseif( tribe_is_day() ) { // Single Event Days
} elseif( tribe_is_venue() ) { // Single Venues
} elseif( tribe_is_upcoming() || tribe_is_showing_all() || tribe_is_past() ) {
}
else {
wp_dequeue_script( 'tribe-events-pjax' );
wp_dequeue_script( 'tribe-events-calendar-script' );
wp_dequeue_style( 'tribe-events-calendar-style' );
}
@ooobo
Copy link
Author

ooobo commented Jun 23, 2012

I added an extra line of conditionals to account for list-view pages (upcoming, past, all events).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment