Support

Home Forums Event Espresso Premium Display all Event Datetimes in template

Display all Event Datetimes in template

Posted: May 22, 2018 at 8:14 pm


REAIE

May 22, 2018 at 8:14 pm

I am looking to display all of an events dates and times in a custom template. I understand I can access the object with espresso_event_date_obj($post->ID) but this has a lot of data in it I don’t need and I’m assuming there’s a function which abstracts it, I’m looking for something like espresso_event_datetimes()?


Tony

  • Support Staff

May 23, 2018 at 2:14 am

Hi there,

To display the event dates, you need the events datetime (espresso_event_date_obj() returns the primary datetime for an event), if it has multiple datetimes you may need more than one. Whilst the datetime object itself has more info than just dates you still need that object to pull the date from.

However, the espresso_event_date_obj() is a template_tag, it’s a helper method that is used to output the details and we do have more of them, take a look in \event-espresso-core-reg\public\template_tags.php for mre but one you may find useful is espresso_list_of_event_dates()

If the output of that function does not suit it shows you how you can pull all of the events datetimes using the EEH_Event_View helper methods and output your own content however you prefer.

Does that help?


REAIE

May 31, 2018 at 7:12 pm

espresso_list_of_event_dates() is exactly what I was looking for thanks!


Tony

  • Support Staff

June 1, 2018 at 1:33 am

You’re most welcome 🙂

The support post ‘Display all Event Datetimes in 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 2 months, 2 weeks ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!