Skip to content

Instantly share code, notes, and snippets.

@iammilton82
Created August 31, 2013 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iammilton82/6397869 to your computer and use it in GitHub Desktop.
Save iammilton82/6397869 to your computer and use it in GitHub Desktop.
Events Loop for The Events Calendar
<?
global $post;
$events = new WP_Query();
$events->query( array('post_type'=> 'tribe_events', 'eventDisplay' => 'all', 'posts_per_page' => 3));
if ( $events->have_posts() ){
echo "<ul>";
while ( $events->have_posts() )
{
$events->the_post();
$eventId = $events->ID;
?>
<li>
<div class='event-date'><?=tribe_get_start_date($eventId, true, 'l, F d, Y') ?></div>
<h2><a href="<?=tribe_get_event_link($eventId)?>"><? the_title() ?> </a></h2>
<div class='venue-name'><?=tribe_get_venue($eventId)?></div>
<div class='location'><?=tribe_get_city($eventId)?>, <?=tribe_get_state($eventId)?></div>
</li>
<?
}
echo "</ul>";
} else {
echo "<p>There are no upcoming events available at this time. Visit us again soon!</p>";
}
wp_reset_query();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment