Skip to content

Instantly share code, notes, and snippets.

@BeardedGinger
Created March 16, 2015 04:31
Show Gist options
  • Select an option

  • Save BeardedGinger/0e321d1e8b67cb596e6d to your computer and use it in GitHub Desktop.

Select an option

Save BeardedGinger/0e321d1e8b67cb596e6d to your computer and use it in GitHub Desktop.
Add Featured Image to Events Calendar Month View
<?php
/**
* Month Single Event
* This file contains one event in the month view
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/single-event.php
*
* @package TribeEventsCalendar
*
*/
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
} ?>
<?php
global $post;
$day = tribe_events_get_current_month_day();
$event_id = "{$post->ID}-{$day['daynum']}";
$start = tribe_get_start_date( $post, false, 'U' );
$end = tribe_get_end_date( $post, false, 'U' );
?>
<div id="tribe-events-event-<?php echo $event_id ?>" class="<?php tribe_events_event_classes() ?>" data-tribejson='<?php echo tribe_events_template_data( $post ); ?>'>
<h3 class="tribe-events-month-event-title entry-title summary"><a href="<?php tribe_event_link( $post ); ?>" class="url"><?php the_title() ?></a></h3>
<?php if (has_post_thumbnail() && 1 === $day['total_events']) : ?>
<div class="tribe-events-event-thumb"><?php echo the_post_thumbnail(array(90,90));?></div>
<?php endif; ?>
</div><!-- #tribe-events-event-# -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment