Support

Home Forums Event Espresso Premium Display Date and Time in Custom Archive Template

Display Date and Time in Custom Archive Template

Posted: January 19, 2015 at 9:34 am


evan fort

January 19, 2015 at 9:34 am

Hi there! I’ve created a custom archive template, that uses wp_query to show events. Currently I’m using <?php espresso_event_date('M d, Y'); ?> to show the date; however it prints the date and time. Is there a way to only show the date or date range and show the time separately? Similar to the way it’s displayed on the individual event pages.

Ex: January 19, 2015
10:00am – 12:00pm

Ex: January 19, 2015 – January 20, 2015
10:00am – 12:00pm


Dean

January 20, 2015 at 6:08 am

This should work:

espresso_event_date( $date_format = 'M d, Y', $time_format = ' ');

The space in the time format value is important!

So something like this might work for you

echo "<p>" .espresso_event_date( $date_format = 'M d, Y', $time_format = ' ') . "</p>";
echo "<p>" . espresso_event_date( $date_format = ' ', $time_format = '') . "</p>";


evan fort

January 20, 2015 at 9:54 am

thanks!

The support post ‘Display Date and Time in Custom Archive Template’ 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