[Résolu] Events Manager: Default Layout for user-submitted events
This support ticket is created Il y a 6 années et 11 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
It's not exactly the same, however, due to either changes in one or both plugins, or due to my setup being not exactly the same as the original poster.
In my case, I am having the same problem with Recurring Events, except that I need a Layout assigned rather than a Content Template. I have tried modifying the function offered as a solution in the above link, but have not found the proper combination to make it work.
My screenshot looks almost exactly the same as the above link except that I am trying to assign a "Template Layout" instead of a "Content Template." What should the function look like to make this work when new events are submitted from the Events Manager front-end form?
Now - after creating and assigning the layout - if you still see that after creating the event from front end the layout is not assigned then you should use following code:
Thank you. I've now got this working thanks to your help.
'add_post_meta', rather than 'update_post_meta' from the example in the other support thread I linked, was half of the solution.
The other half was using 'event-recurring' rather than 'event' for the post type. This doesn't have anything to do with you, rather the Events Manager plugin, but was vital to the solution as well.
Here's what the successful code looks like, for anyone else that might be in my situation in the future...