Created
September 20, 2012 21:17
-
-
Save jo-snips/3758396 to your computer and use it in GitHub Desktop.
The Events Calendar: Limit Recurring Event List
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $upcoming = new WP_Query(); | |
| $upcoming->query( array( | |
| 'post_type' => 'tribe_events', | |
| 'eventDisplay' => 'upcoming', | |
| 'posts_per_page' => 10, | |
| ) ); | |
| $postids = Array(); | |
| if ($upcoming->have_posts()) : | |
| while ($upcoming->have_posts()) : | |
| $upcoming->the_post(); | |
| $thisid = get_the_ID(); | |
| if ( !in_array($thisid, $postids)) : | |
| array_push( $postids, $thisid); | |
| ?> | |
| <div class="the-event"> | |
| <p><?php the_title(); ?></p> | |
| </div> | |
| <?php | |
| endif; | |
| endwhile; | |
| endif; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just fyi you probably should use TribeEvents::POSTTYPE when setting post type for wp_query.