Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihorduchenko/cb0ebd1a94441508e3b0e3c1c624a339 to your computer and use it in GitHub Desktop.
Save ihorduchenko/cb0ebd1a94441508e3b0e3c1c624a339 to your computer and use it in GitHub Desktop.
The Events Calendar: Custom Date/Time Display
<?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
<dt class="event-label event-label-start"><?php _e('Starts:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-start"><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-from"><?php _e('From:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-from"><meta itemprop="fromTime" content="<?php echo tribe_get_start_date( null, false, 'g:ia' ); ?>"/><?php echo tribe_get_start_date( null, false, 'g:ia' ); ?> to <?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' ); ?>"/><?php echo tribe_get_start_date(); ?></dd>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment