Created
October 16, 2014 14:37
-
-
Save jesseeproductions/4b215d2b854a6f6cb649 to your computer and use it in GitHub Desktop.
Exclude Categories from Month View of the Events Calendar
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
/** | |
* 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