Support

Home Forums Event Espresso Premium Event Category Class

Event Category Class

Posted: June 8, 2020 at 7:40 am

Viewing 1 reply thread


abcissa

June 8, 2020 at 7:40 am

Hi,
I can see that a class is added for all events within a category of the type
‘espresso_event_categories-name’ and it is added to the <article> tag.

If there any way I can add this class ‘higher up’ i.e. add it to the <body> tag

thank you
Phil


Tony

  • Support Staff

June 8, 2020 at 8:59 am

Hi Phil,

Yes, you can use a function like this one:

https://gist.github.com/Pebblo/6ba85a263e9f9d67d70b1febbe0e6aa9

Although to match what you are requesting you’ll need to change line 14 from:

$classes[] = 'category-' . $custom_term->slug;

To

$classes[] = 'espresso_event_categories-' . $custom_term->slug;

Then add that function to a custom functions plugin on the site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

Viewing 1 reply thread

The support post ‘Event Category Class’ 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