Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. /*
  2. * The Events Calendar Remove Events from Month and List Views
  3. * add coding to theme's functions.php
  4. * @version 3.12
  5. * modify here with event category slugs: array( 'concert', 'convention' )
  6. */
  7. add_action( 'pre_get_posts', 'tribe_exclude_events_category_month_list' );
  8. function tribe_exclude_events_category_month_list( $query ) {
  9.  
  10. if ( isset( $query->query_vars['eventDisplay'] ) && ! is_singular( 'tribe_events' ) && ! tribe_is_community_my_events_page() ) {
  11.  
  12. if ( $query->query_vars['eventDisplay'] == 'list' && ! is_tax( Tribe__Events__Main::TAXONOMY ) || $query->query_vars['eventDisplay'] == 'month' && $query->query_vars['post_type'] == Tribe__Events__Main::POSTTYPE && ! is_tax( Tribe__Events__Main::TAXONOMY ) && empty( $query->query_vars['suppress_filters'] ) ) {
  13.  
  14. $query->set( 'tax_query', array(
  15.  
  16. array(
  17. 'taxonomy' => Tribe__Events__Main::TAXONOMY,
  18. 'field' => 'slug',
  19. 'terms' => array( 'kids-camp-programs', 'kids-programs-and-workshops' ),
  20. 'operator' => 'NOT IN'
  21. )
  22. ) );
  23. }
  24.  
  25. }
  26.  
  27. return $query;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement