Hi, I’m using EE4 with Elementor. To have more flexibility in terms of page design, I’d like to be able to display an event’s datetimes anywhere I want using a shortcode, just like the ticket selector shortcode, so something like [ESPRESSO_DATE_TIME event_id=your_event_id].
Thanks,
Martin
There are a few situations you will need to account for in a shortcode like this, especially when pulling a single (or multiple?) DateTime(s) based on the event ID, as a single event can have multiple datetimes.
So, for example, would a shortcode like the above always pull the ‘next’ upcoming DateTime or list all DateTimes on an event?
If showing the next upcoming datetime what if the shortcode was used on a page for 1 instance of a datetime and then used later for another, the ‘previous’ page may now be outdated with the ‘wrong’ date.
You may be better creating a shortcode to pull specific datetimes based on the DateTime ID but it all depends on your use case for this.
The support post ‘EE4 Event DateTime Shortcode?’ 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.