Guest User

Show 1 instance of recurring event w/ Event Calendar PRO

a guest
Jun 14th, 2012
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2.     $upcoming = new WP_Query();
  3.     $upcoming->query( array(
  4.         'post_type' => 'tribe_events',
  5.         'eventDisplay' => 'upcoming',
  6.         'posts_per_page' => 10,
  7.         ) );
  8.     $postids = Array();
  9.     if ($upcoming->have_posts()) :
  10.     while ($upcoming->have_posts()) :
  11.     $upcoming->the_post();
  12.     $thisid = get_the_ID();
  13.  
  14.     if ( !in_array($thisid, $postids)) :
  15.         array_push( $postids, $thisid);
  16. ?>
  17. <div class="the-event">
  18.     <p><?php the_title(); ?></p>
  19. </div>
  20.  
  21. <?php
  22.     endif;
  23.     endwhile;
  24.     endif;
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment