Skip to content

Instantly share code, notes, and snippets.

@nefeline
Last active September 12, 2018 14:58
Show Gist options
  • Save nefeline/d74ff6806108771b4da7b951eff57753 to your computer and use it in GitHub Desktop.
Save nefeline/d74ff6806108771b4da7b951eff57753 to your computer and use it in GitHub Desktop.
Displays the time of the event in the Month View Calendar
<?php
/**
* Month Single Event
* Description: Displays the time of the event in the Month View Calendar (If the event lasts all day, the time is hidden).
* Author: Patricia Hillebrandt
* This is a template override for The Events Calendar's single-event.php.
* This template must be placed in [your-theme]/tribe-events/month/single-event.php
*/
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
global $post;
$day = tribe_events_get_current_month_day();
$event_id = "{$post->ID}-{$day['daynum']}";
$link = tribe_get_event_link( $post );
$title = get_the_title( $post );
?>
<div id="tribe-events-event-<?php echo esc_attr( $event_id ); ?>" class="<?php tribe_events_event_classes() ?>" data-tribejson='<?php echo esc_attr( tribe_events_template_data( $post ) ); ?>'>
<div class="event-time"><?php if ( ! tribe_event_is_all_day() ) { echo tribe_get_start_date( $post->ID, false, 'g:ia' ); } ?></div>
<h3 class="tribe-events-month-event-title"><a href="<?php echo esc_url( $link ) ?>" class="url"><?php echo $title ?></a></h3>
</div><!-- #tribe-events-event-# -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment