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()?
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.
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.