I’d like to put on My Events Page, only the start date and start time. For example: When I’m logged in, I have on my events page:
Title Location When … Actions
Event 1 Location 1 March 16, 2017 5:30 pm – March 17, 2017 9:30 pm
Event 2 Location 2 March 23, 2017 9:30 am – March 23, 2017 5:00 pm
I’d like:
Title Location When … Actions
Event 1 Location 1 March 16, 2017 5:30 pm
Event 2 Location 2 March 23, 2017 9:30 am
This can be done by using moving a copy of the content-espresso_my_events-event_section.template.php to a child theme’s folder and then making changes to remove end time.
The content-espresso_my_events-event_section.template.php file can be found in this location:
At around line 28, you’ll see in use espresso_event_date_range.
You can create your own version of espresso_event_date_range by copying it from the template_tags.php file in the core Event Espresso plugin to the child theme’s functions.php file and then changing the name (e.g. custom_ espresso_event_date_range) and how it works so it shows the first part of the range only.
At about line 580, you’ll see this:
__( ‘%1$s – %2$s’, ‘event_espresso’ ),
If you remove the “- %2$s” then it will show just the first part of the date range.
Then you can update the content-espresso_my_events-event_section.template.php file to use your custom_ espresso_event_date_range function.
Rather than creating a date range function that no longer outputs a date range you can just pull the earliest start date for the event and output that.
Its basically the same as what espresso_event_date_range() does but it then goes on to pull the later date and creates a range.
You should just get the earliest event start date shown on the output.
Note to do this you will still need to copy content-espresso_my_events-event_section.template.php to your child theme and edit the template with the above.
The support post ‘How to put Start Date and Time in My Events 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.
Support forum for Event Espresso 3 and Event Espresso 4.