daily pastebin goal
22%
SHARE
TWEET

Show first recurring event only (in main blog loop)

BakerMan Jan 28th, 2014 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top