Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Created March 13, 2012 04:14
Show Gist options
  • Save jo-snips/2026688 to your computer and use it in GitHub Desktop.
Save jo-snips/2026688 to your computer and use it in GitHub Desktop.
The Events Calendar: Alternate Single Event Date Display
<?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
<dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-date"><meta itemprop="startDate" content="<?php echo tribe_get_start_date(null, false, 'Y-m-d'); ?>"/><?php echo tribe_get_start_date(null, false, 'F j, Y'); ?></dd>
<dt class="event-label event-label-start"><?php _e('Time:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-start"><meta itemprop="startDate" content="<?php echo tribe_get_start_date(null, false, 'h:i:s'); ?>"/><?php echo tribe_get_start_date(null, false, 'g:ia'); ?> to <meta itemprop="endDate" content="<?php echo tribe_get_end_date( null, false, 'h:i:s' ); ?>"/><?php echo tribe_get_end_date(null, false, 'g:ia'); ?></dd>
<?php } else { ?>
<dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-date"><meta itemprop="startDate" content="<?php echo tribe_get_start_date(null, false, 'Y-m-d-h:i:s'); ?>"/><?php echo tribe_get_start_date(null, false, 'F j, Y'); ?></dd>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment