Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
Created October 16, 2014 14:37
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 jesseeproductions/4b215d2b854a6f6cb649 to your computer and use it in GitHub Desktop.
Save jesseeproductions/4b215d2b854a6f6cb649 to your computer and use it in GitHub Desktop.
Exclude Categories from Month View of the Events Calendar
/**
* Exclude Categories from Month View of the Events Calendar
* Change 'Concert','Convention' to your Event Category Names to work
*/
add_action( 'pre_get_posts', 'exclude_events_category' );
function exclude_events_category( $query ) {
if ( tribe_is_month() && !is_tax() ) {
$query->set( 'tax_query', array(
array(
'taxonomy' => TribeEvents::TAXONOMY,
'field' => 'slug',
'terms' => array('Concert','Convention'),
'operator' => 'NOT IN'
)
)
);
}
return $query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment