_EventDuration multi day event
Thanks for reaching out to us! Let me help you with that issue.
When you say:
the _EventDuration field listed on the WordPress post meta page is not being propagated on the newly added events.
Do you mean the _EventDuration field is not being saved in the database for the newly added events? If not, where are you seing this info missing? Let us know about it.
To explore what’s going on, I added code on a test page which writes the content of _EventDuration to the page. Events which were added in the past display the duration correctly, in seconds, for short, all day, and multi-day all day events. The recently added events referenced above display nothing for duration. The start and end timestamps are correct for all events.
Thank for coming back explaining what you’ve found so far.
I made a couple of tests and the event duration is saving correctly for single and multi day events.
I’m not very familiar with the Custom Content plugin, so I’m not really sure how it works. But, to make sure the _EventDuration postmeta is saving, you should look that up in the database. For example, you could search the post_id (of the event you are having trouble with) in the wp_postmeta table and see if there is a _EventDuration meta_key saved for that venue.
If there is, then the issue could be related to the Custom Content plugin. If not, then there could be a theme or plugin conflict, so you should go through the testing for conflicts guide here > https://theeventscalendar.com/knowledgebase/testing-for-conflicts/ and see what you find in the process.
Let me know how that goes and if you have any questions.
I need to be able to distinguish between one day and multi day all day events. One day only the start date displays, multi day both start and end dates display. Checking for start date not equal to end date doesn’t work because the dates are saved as timestamps, and for all day events start TIME is 00:00:00 and end time is 23:59:59. Is there a snippet I could add to our functions.php file that would save the _EventDuration metadata for all events? Thx, Susan
I’d be happy to help you with this.
First off, I do want to note that we are fairly limited in how much we can support custom development questions like this.
That said, I’d be happy to at least point you in the right direction as best I can.
We have a couple of helper functions that will allow you to check if an event is a multi day event or if it’s an all day event. One is tribe_event_is_multiday() and the other one is tribe_event_is_all_day()
I know you are using the Custom Content plugin, which I’m not very familiar with, but perhaps you can make use of these functions with it.
We also have a great article that will get you started on customizing our templates here > https://theeventscalendar.com/knowledgebase/themers-guide/
I hope that helps and let me know if you have other questions.
Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team