Forum Replies Created
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
jwhite
ParticipantHi Geoff,
That worked great, thank you! 🙂October 12, 2015 at 4:32 pm in reply to: Hide Category from Main Calendar, but not Category Calendar #1013911jwhite
ParticipantThat worked. Thank you so much, Brian!
October 8, 2015 at 11:41 am in reply to: Hide Category from Main Calendar, but not Category Calendar #1012787jwhite
ParticipantThank you for the reply, Brian. I added the code that you linked to here: https://gist.github.com/jesseeproductions/a467b28a8b8010d4015b on to my theme’s functions.php – it did not hide the categories I’m looking to hide. Here is what I added:
// Removes categories "tech" from list and month views add_action( 'pre_get_posts', 'exclude_events_category' ); function exclude_events_category( $query ) { if ( ! is_singular( 'tribe_events' ) && $query->query_vars['eventDisplay'] == 'list' && !is_tax(TribeEvents::TAXONOMY) || $query->query_vars['eventDisplay'] == 'month' && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) && empty( $query->query_vars['suppress_filters'] ) ) { $query->set( 'tax_query', array( array( 'taxonomy' => TribeEvents::TAXONOMY, 'field' => 'slug', 'terms' => array('agency-distribution,community-market,mobile-pantry'), 'operator' => 'NOT IN' ) ) ); } return $query; }Before I created this post, I used the code here: https://gist.github.com/theeventscalendar/c9580839c3a76778d583
on my functions.php file. It did hide the events in the category from the main calendar, but it also hid the events from their own category calendar – which is where I want them to appear. -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
