Skip to content

Instantly share code, notes, and snippets.

@kelly-tribe
Created October 24, 2013 01:19
Show Gist options
  • Select an option

  • Save kelly-tribe/7129724 to your computer and use it in GitHub Desktop.

Select an option

Save kelly-tribe/7129724 to your computer and use it in GitHub Desktop.
TEC Month View with thumb in grid for day with single event
<?php
/**
* Adapted version of month/single-event.php.
*
* Displays the post thumb in the grid *only* if it is the
* only event showing that day.
*/
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() ?>">
<h3 class="tribe-events-month-event-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 id="tribe-events-tooltip-<?php echo $event_id; ?>" class="tribe-events-tooltip">
<h4 class="summary"><?php the_title() ?></h4>
<div class="tribe-events-event-body">
<?php echo tribe_events_event_schedule_details() ?>
<?php if (has_post_thumbnail() ) : ?>
<div class="tribe-events-event-thumb"><?php echo the_post_thumbnail(array(90,90));?></div>
<?php endif; ?>
<p class="entry-summary description">
<?php echo get_the_excerpt() ?>
</p><!-- .entry-summary -->
</div><!-- .tribe-events-event-body -->
<span class="tribe-events-arrow"></span>
</div><!-- .tribe-events-tooltip -->
</div><!-- #tribe-events-event-# -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment