Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Created April 4, 2012 19:56
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 jo-snips/2305130 to your computer and use it in GitHub Desktop.
Save jo-snips/2305130 to your computer and use it in GitHub Desktop.
Thesis: Set Sidebars Specifically with The Events Calendar
// Conditionally remove original sidebars
function no_sidebars() {
global $wp_query;
if('tribe_events' == get_post_type()) {
if ( $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && is_single() && !is_tax(TribeEvents::TAXONOMY) ) { // single event
return true;
} elseif ( $wp_query->query_vars['eventDisplay'] == 'upcoming' || $wp_query->query_vars['eventDisplay'] == 'past' && $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) ) { // list view
return true;
} elseif ( $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && $wp_query->query_vars['eventDisplay'] == 'month' && !is_tax(TribeEvents::TAXONOMY) ) { // grid view
return false;
} elseif ( $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && $wp_query->query_vars['eventDisplay'] == 'month' && is_tax(TribeEvents::TAXONOMY) ) { // grid view categories
return false;
} elseif ( $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && tribe_is_day() ) { // single event days
return false;
}
} elseif( $wp_query->query_vars['post_type'] == TribeEvents::VENUE_POST_TYPE ) { // venues
return false;
} else {
return true;
}
}
add_filter('thesis_show_sidebars', 'no_sidebars');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment