Support

Home Forums Event Espresso Premium Add labels to Date/Times on single Event page

Add labels to Date/Times on single Event page

Posted: December 23, 2015 at 3:36 pm


Mana Retreat

December 23, 2015 at 3:36 pm

Hi Support

Currently the Date and Time of an event is displayed as:
January 2, 2016 – January 8, 2016
3:00 pm – 2:00 pm

Is it possible to prepend a label to the Time part as follows:
January 2, 2016 – January 8, 2016
Check In Time – 3:00 pm
Check Out Time – 2:00 pm

Kind regards Stephen


Josh

  • Support Staff

December 23, 2015 at 4:21 pm

Hi Stephen,

It’s possible and it involves a bit of PHP code modifying. The template tag that’s used to display those times is espresso_list_of_event_dates(). This template tag or function is in the /public/template_tags.php file. You can actually copy the espresso_list_of_event_dates() function into your own little custom plugin, then make your modifications there.

Once you have things set up to modify, you’ll edit this line of code:

$html .= '<span class="dashicons dashicons-clock"></span>' . $datetime->time_range( $time_format );

and change it to something like this:

$html .= '<span class="dashicons dashicons-clock"></span>';
$html .= '<strong>Check In Time &mdash; </strong>' . $datetime->start_time( $time_format ) . '<br />';
$html .= '<span class="dashicons dashicons-clock"></span>';
$html .= '<strong>Check Out Time &mdash; </strong>' . $datetime->end_time( $time_format ) . '<br />';


Mana Retreat

December 23, 2015 at 4:58 pm

Hi Josh
Fantastic. Worked perfectly.
Many thanks Stephen

The support post ‘Add labels to Date/Times on single Event page’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso