-
-
Save paulgeisler/7571338 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $post; | |
$current_date = date('j M Y'); | |
$end_date = date('j M Y', strtotime('1 month')); | |
echo 'Start Date:'. $current_date; | |
echo 'End Date:'. $end_date; | |
$all_events = tribe_get_events( | |
array( | |
'start_date' => $current_date, | |
'end_date'=> $end_date, | |
'posts_per_page' => 5 | |
) | |
); | |
foreach($all_events as $post) { | |
setup_postdata($post); | |
?> | |
<h3 class="entry-title"><a href="<?= tribe_get_event_link($post) ?>"><?php the_title(); ?></a></h3> | |
<div style="margin-bottom: 1em"> | |
<span class="event-date"><a href="<?= tribe_get_event_link($post) ?>"><?php echo tribe_get_start_date($post->ID, true, 'M j, Y'); ?></a></span> | |
<?php if ( has_post_thumbnail() ) { ?> | |
<div class="event-thumb"> | |
<a href="<?= tribe_get_event_link($post) ?>"><?php the_post_thumbnail('thumbnail'); ?></a> | |
</div> | |
<div class="event-excerpt"> | |
<?php the_excerpt(); ?> | |
</div> | |
<?php } else { ?> | |
<div class="event-content"> | |
<?php the_content(); ?> | |
</div> | |
<?php } ?> | |
</div> | |
<?php } ?> | |
<?php wp_reset_query(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment