Advertisement
BakerMan

Untitled

May 27th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. // Load events (you may wish to increase the number of posts_per_page)
  2. $events = tribe_get_events();
  3. $used_events = array();
  4.  
  5. foreach ($events as $event) {
  6.     // Set things up so we can use regular WP template tags
  7.     $GLOBALS['post'] = $event;
  8.     setup_postdata($event);
  9.  
  10.     // Don't display duplicated
  11.     if (in_array(get_the_ID(), $used_events)) continue;
  12.     $used_events[] = get_the_ID();
  13.  
  14.     // Your code to dispay the event...
  15.     echo '<p>' . tribe_get_start_date($event->ID) . ': ' . get_the_title() . '</p>';
  16. }
  17.  
  18. // Cleanup
  19. wp_reset_postdata();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement