Support

Home Forums Event Espresso Premium halt injecting of events-tickets, event-datetimes & events-venues in the_content

halt injecting of events-tickets, event-datetimes & events-venues in the_content

Posted: March 17, 2017 at 7:05 pm

Viewing 3 reply threads


hostingct

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.

Code Example


hostingct

March 17, 2017 at 7:09 pm

the code example image I inserted isn’t displaying. You can right click and select “view image” or I’ll paste the url here.

http://prnt.sc/elbyib


Tony

  • Support Staff

March 18, 2017 at 5:55 am

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 espresso_event_content_or_excerpt() and the_content() will have the details injected into them, unless you are using a custom single-espresso_events.php template file. EE detects if singe-espresso_events.php or archive-espresso_events.php is in use and does not inject details….

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:


//Use the custom template order when using single-espresso_events.php template file.
add_filter( 'FHEE__EED_Event_Single__template_include__allow_custom_selected_template', '__return_true' );

//Use the custom template order when using archive-espresso_events.php template file.
add_filter( 'FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', '__return_true' );

Do you have either of those filters on the site currently? If so, either remove them or change them to __return_false


hostingct

March 18, 2017 at 9:14 am

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!

Viewing 3 reply threads

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.

Event Espresso