Skip to content

Instantly share code, notes, and snippets.

Created June 14, 2012 16:52
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 anonymous/2931459 to your computer and use it in GitHub Desktop.
Save anonymous/2931459 to your computer and use it in GitHub Desktop.
add_action( 'pre_get_posts', 'exclude_events_category' );
function exclude_events_category( $query ) {
if ( $query->query_vars['post_type'] == TribeEvents::POSTTYPE && $query->query_vars['eventDisplay'] == 'month' && !is_tax(TribeEvents::TAXONOMY) && empty( $query->query_vars['suppress_filters'] ) ) {
$query->set( 'tax_query', array(
array(
'taxonomy' => TribeEvents::TAXONOMY,
'field' => 'id',
'terms' => 49,
'operator' => 'NOT IN'
)
) );
}
return $query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment