Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Load events (you may wish to increase the number of posts_per_page)
- $events = tribe_get_events();
- $used_events = array();
- foreach ($events as $event) {
- // Set things up so we can use regular WP template tags
- $GLOBALS['post'] = $event;
- setup_postdata($event);
- // Don't display duplicated
- if (in_array(get_the_ID(), $used_events)) continue;
- $used_events[] = get_the_ID();
- // Your code to dispay the event...
- echo '<p>' . tribe_get_start_date($event->ID) . ': ' . get_the_title() . '</p>';
- }
- // Cleanup
- wp_reset_postdata();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement