Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Last active December 14, 2015 08:28
Show Gist options
  • Select an option

  • Save jo-snips/5057772 to your computer and use it in GitHub Desktop.

Select an option

Save jo-snips/5057772 to your computer and use it in GitHub Desktop.
The Events Calendar - Get Single Months Events
<h1>January 2013</h1>
<?php
global $post;
$current_date = '2013-01-01';
$end_date = '2013-01-31';
echo '<p>Start Date: ' . $current_date . '</p>';
echo '<p>End Date: ' . $end_date . '</p>';
$get_posts = tribe_get_events(array('start_date'=>$current_date,'end_date'=>$end_date,'posts_per_page'=>10) );
foreach($get_posts as $post) { setup_postdata($post); ?>
<div class="events-date"><?php echo tribe_get_start_date($post->ID, false, 'F j, Y'); ?></div>
<div class="events-title"><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2></div>
<?php } //endforeach ?>
<?php wp_reset_query(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment