Support

Home Forums Event Espresso Premium WP template body class lost on EE4 pages.

WP template body class lost on EE4 pages.

Posted: March 11, 2015 at 9:34 pm

Viewing 5 reply threads


jamieshek

March 11, 2015 at 9:34 pm

Hi,

I’m using the a custom page template. On ‘normal’ pages the template name is added as a class in the body like so:

<body class="page page-id-149 page-child parent-pageid-168 page-template page-template-custom--page--livewell--category page-template-custom--page--livewell--category-php logged-in admin-bar customize-support">

I’m using the custom page ID for styling however when I get to the EE4 pages these classes are lost. Even though they are using the same custom page template. Like so:

<body class="single single-espresso_events postid-91 logged-in admin-bar customize-support">

Is there a way to show the class on EE4 pages?


Dean

March 12, 2015 at 5:44 am

Hi,

Which Pages are you referring to exactly?

Can you provide examples of a correct page and a page missing the details?


jamieshek

March 12, 2015 at 4:52 pm

Hi Dean. Thanks for your reply.

This page is a standard wordpress page using a custom template. It pulls EE4 content using the shortcode tag. http://27.131.106.40/~lendleaseadmin/live-well-passport/march-starting-your-live-well-journey/

On this page the body has class=”page page-id-149 page-child parent-pageid-168 page-template page-template-custom–page–livewell–category page-template-custom–page–livewell–category-php”

The template class ‘page-template-custom–page–livewell–category’ is important to me in this case.

When you get move away from the wordpress ‘page’ and onto the event espresso item the template class is not present in the body. Here’s an example page:

http://27.131.106.40/~lendleaseadmin/events/get-on-board-come-along-to-our-launch-event/

Despite the event using the same template above the body has class=”single single-espresso_events postid-91 logged-in admin-bar customize-support”

I appreciate your help.

Thanks,
Jamie


jamieshek

March 12, 2015 at 5:09 pm

Although now after testing I see the event page is not using my custom page even though I have selected it…

Do you know how I can force the event to use my custom template?


jamieshek

March 12, 2015 at 5:43 pm

OK. So out of the box the EE4 event Page Template doesn’t seem to work.

With help from the is post (https://eventespresso.com/topic/events-details-page-use-blog-post-template-how-change-to-default-page-template/) I installed a plugin to allow custom post types to use page templates.

After installation I now have two options to select a custom page template. The one out of the box and the one created by the plugin. If I set the plugins page template that seems to the trick.

I’m not sure why the EE4 page template option is not working…


Josh

  • Support Staff

March 13, 2015 at 11:41 am

Hi there,

If you deactivate the plugin that adds the custom page template metabox, does the built in template switcher work?

As an aside, if you want all of the single event posts to use the same page template, you can make a copy of the desired page template, then rename it to be single-espresso_events.php. Then you can add this in the loop of that template to pull in event content:

espresso_get_template_part( 'content', 'espresso_events' );

Viewing 5 reply threads

The support post ‘WP template body class lost on EE4 pages.’ 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