Support

Home Forums Event Espresso Premium How to put Start Date and Time in My Events Page

How to put Start Date and Time in My Events Page

Posted: March 16, 2017 at 12:29 pm

Viewing 3 reply threads


psg_napkin_dev

March 16, 2017 at 12:29 pm

Hi

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

Thanks in advance


Lorenzo Orlando Caum

  • Support Staff

March 17, 2017 at 10:38 am

Hello,

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:

/wp-content/plugins/eea-wp-user-integration/templates/content-espresso_my_events-event_section.template.php

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.


Lorenzo


Tony

  • Support Staff

March 17, 2017 at 11:48 am

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.

So if replace this:

espresso_event_date_range('', '', '', '', $event->ID() );

with something like this:

$the_event_start_date = EEH_Event_View::the_earliest_event_date( '', '', $event->ID() );
echo $the_event_start_date;

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.


psg_napkin_dev

March 20, 2017 at 10:51 am

Thanks Guys

Viewing 3 reply threads

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.

Event Espresso