Support

Home Forums Event Espresso Premium Remove times

Remove times

Posted: March 21, 2018 at 4:06 pm


kdaily

March 21, 2018 at 4:06 pm

Is there a way to seperate times from the dates so that it just displays the date of the class and not the time on both the event table and the event pages?


Tony

  • Support Staff

March 23, 2018 at 6:10 am

Hi there,

Those changes will require customisation to the PHP used to output the display, are you comfortable with PHP, HTML and FTP?


kdaily

March 23, 2018 at 6:11 am

Yup!


Tony

  • Support Staff

March 23, 2018 at 6:20 am

Ok, so for the table view template, you copy the original template and place it within the root directory of a child theme, so copy this file:

/wp-content/plugins/eea-events-table-view-template/templates/espresso-events-table-template.template.php

Around line 148 you’ll have something like this:

echo date_i18n( $date_format . ' ' . $time_format, strtotime( $datetime->start_date_and_time('Y-m-d', 'H:i:s') ) );

Change that to:

echo date_i18n( $date_format, strtotime( $datetime->start_date('Y-m-d') ) );

For the event page the function used is pluggable, so you can this function to your child theme’s functions.php file:

https://gist.github.com/joshfeck/3673d6cec882edba8abd


kdaily

March 23, 2018 at 6:44 am

Ok, I’ve got the table template done and the event pages done. How do I remove the time from the emails?


Tony

  • Support Staff

March 23, 2018 at 7:24 am

You’ll need to edit those from within the admin, each template needs to be edited individually.

So for example, go to Event Espresso -> Messages -> Default messages templates -> Registration Approved -> Registrant.

Make sure you are editing the correct context:

https://eventespresso.com/wiki/messages-system-working-with-message-contexts/

In the DATETIME_LIST section you’ll have:

<li>[DATETIME_START] - [DATETIME_END]</li>

Change that to:

<li>[DATE_START] - [DATE_END]</li>

Save and retest.

The support post ‘Remove times’ 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