March 21, 2018
Use the below example to custom format the date displayed when querying Tribe events.
<?php $events = tribe_get_events( array(
'posts_per_page' => 3,
'start_date' => current_time( 'Y-m-d' ),
) );
foreach($events as $post) : setup_postdata($post); ?>
<li>
<?php if(has_post_thumbnail()) { ?>
<a href="<?php the_permalink(); ?>">
<div class="event_content with_thumb">
<div class="event_image"></div>
<div class="event_info">
<h2 class="event_date"><?php echo tribe_get_start_date( $post, false, 'M d' ); ?></h2>
<h3 class="event_title"><?php the_title(); ?></h3>
</div>
</div>
</a>
<?php } else { ?>
<a href="<?php the_permalink(); ?>">
<div class="event_content">
<div class="event_info">
<h2 class="event_date"><?php echo tribe_get_start_date( $post, false, 'M d' ); ?></h2>
<h3 class="event_title"><?php the_title(); ?></h3>
</div>
</div>
</a>
<?php } ?>
</li>
<?php endforeach; wp_reset_postdata(); ?>
Alternate format example:
<?php echo tribe_get_start_date( $post, false, 'l, F j, Y' ); ?>