Posted: March 17, 2017 at 7:05 pm
Hello, I’m working on integrating event espresso into a custom theme and have what I hope will be a simple question. I’m overriding the default espresso theme files in my theme so I can modify the wrapping markup. Everything is going as expected except when I call the content-espresso_events-details.php template file. The espresso_event_content_or_excerpt() helper function looks to be injecting the events-tickets, events-datetimes and events-venues in addition to the events-detail. Even when I simply call the_content() within my loop this seems to be happening (a filter somewhere perhaps)? Currently I’ve worked around this by outputting the event details using do_shortcode(get_the_content()) but am curious if I’m missing something. I’m new to event espresso and feel I’m missing something simple. Please see the attached screenshot for a code example. You’ll notice lines 13 and 14 are commented out. When these are used instead of my work around I see a page that has two ticket selectors, two venues, two datetimes, etc… one from the template files I’m calling, the other from the events-detail template / the_content() call. |
|
the code example image I inserted isn’t displaying. You can right click and select “view image” or I’ll paste the url here. |
|
Hi there, Is the theme based on iced mocha by any chance? Or did you follow a tutorial on modding the templates somewhere? The event details are added by filtering the_content so both However (and this is what I suspect may be your issue) we also have a filter to force EE to continue to intect the details into the content even if those templates are being used:
Do you have either of those filters on the site currently? If so, either remove them or change them to |
|
Perfect. That was it! I was following information from here on how to extend the templates: https://gist.github.com/lorenzocaum/0a35fe4997992fdb1dc5 I’m using the sage starter theme (https://roots.io/sage/docs/theme-wrapper/) which uses a theme wrapper to expand on the default wordpress templating. The wrapper starts with a base.php file which then calls single.php and within there will look for single-CUSTOM_POST_TYPE.php in the /templates directory. This wasn’t triggering what you mentioned, so I had to create a single-event_espresso.php which has priority over single.php and either add my content there or have that file reference the template in the /templates directory. Thanks for pointing me in the right direction. I knew it was something simple! |
|
The support post ‘halt injecting of events-tickets, event-datetimes & events-venues in the_content’ 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.