Skip to content

Instantly share code, notes, and snippets.

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 Archie22is/e6696327b13a36c346e6551cce47d840 to your computer and use it in GitHub Desktop.
Save Archie22is/e6696327b13a36c346e6551cce47d840 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' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment