Advertisement
jonahcoyote

Upcoming & Past Events

Nov 14th, 2011
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <h1>Upcoming events:</h1>
  2.  
  3. <?php global $post;
  4. $upcoming = tribe_get_events( array('eventDisplay'=>'upcoming', 'posts_per_page'=>-1) );
  5. foreach($upcoming as $post) : setup_postdata($post);
  6.  
  7. echo '<h3 class="clearfix"><a href="';
  8. the_permalink();
  9. echo '">';
  10. the_title();
  11. echo '</a></h3>';
  12.  
  13. if ( has_post_thumbnail() ) {
  14.                         echo '<a href="';
  15.                         the_permalink();
  16.                         echo '"><div style="float:left;margin:0 10px 10px 0;" >';
  17.                         the_post_thumbnail('thumbnail');
  18.                         echo '</div></a>';
  19.                         the_excerpt();
  20.                     } else {
  21.                         echo the_excerpt();
  22.                         }
  23.                        
  24.  
  25. endforeach; ?>
  26.  
  27. <h1>Past events:</h1>
  28.  
  29. <?php global $post;
  30. $past = tribe_get_events( array('eventDisplay'=>'past', 'posts_per_page'=>-1) );
  31. foreach($past as $post) : setup_postdata($post);
  32.  
  33. echo '<h3><a href="';
  34. the_permalink();
  35. echo '">';
  36. the_title();
  37. echo '</a></h3>';
  38.  
  39. endforeach; ?>
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement