Support

Home Forums Event Espresso Premium EE4 Single Event Template question

EE4 Single Event Template question

Posted: December 9, 2016 at 2:46 pm


OACESIntake

December 9, 2016 at 2:46 pm

Greetings, experience some weird things while trying to customize the look & feel of an EE4 install. Here’s what’s happening:

It *appears* as though the default install does not use the following template: /event-espresso-core-reg/public/Espresso_Arabica_2014/single-espresso_events.php

(Tested by adding some test characters to the template file that do not appear on the single event page on the front end of the site).

Moving this template file to the theme directory DOES appear to overwrite the default output of the plugin, but the template ordering controls from the WP Dashboard under Events > Templates seem to get entirely disregarded.

I’m assuming this might be because the template in /Espresso_Arabica_2014/ is not what’s getting used by default, so it doesn’t have the code that recognizes the template part order.

Is there another template that does and can be used to customize?


Josh

  • Support Staff

December 9, 2016 at 4:30 pm

It doesn’t use that template. May I ask what exactly are you looking to customize so I can point you in the right direction?


OACESIntake

December 10, 2016 at 3:22 pm

There is a sidebar that’s being pulled in by default, and we’d like to use a different one. There’s some other changes too… like removing the date field that’s getting dropped in, but that could be done using CSS display:none.

It almost feels like it’s using the single.php template…


Tony

  • Support Staff

December 12, 2016 at 6:03 am

It almost feels like it’s using the single.php template…

The output will be using your themes single.php

Event Espresso events are custom post types and so the single view will be displayed in the same way any normal post would, EE basically hooks into the_content and adds the details using that.

Each individual section we add uses its own template which can be loaded from your theme so you can custom each section if needed, or you can also completely take over the template if preferred.

If you have a template named single-espresso_events.php that template will be used to load the EE events (which is why the template from Aribica loads) however when you take over the template EE does not automatically inject all of the event details any more as it is expected you will be completely taking over the output (which is why the load order changes).

So to change the sidebar that loads for EE events, copy your single.php template file and rename the copy to single-espresso_events.php, any changes you make there will only be for EE events.

Now adds this line of code to your functions.php file:

add_filter( 'FHEE__EED_Event_Single__template_include__allow_custom_selected_template', '__return_true' );

That tells EE to continue to use the custom ordering even when you are using the single-espresso_events.php template file.

The support post ‘EE4 Single Event Template question’ 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