Advertisement
BakerMan

Show first recurring event only (in main blog loop)

Jan 28th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. add_action( 'pre_get_posts', 'front_page_next_recurring_event_only', 60 );
  2.  
  3. /**
  4.  * For events integrated into the main blog loop, only include the first upcoming instance of the
  5.  * event.
  6.  *
  7.  * @param WP_Query $query
  8.  */
  9. function front_page_next_recurring_event_only( WP_Query $query ) {
  10.     if ( ! isset( $query->tribe_is_multi_posttype ) || ! $query->tribe_is_multi_posttype ) return;
  11.     $query->set( 'tribeHideRecurrence', 1 );
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement