Support

Home Forums Event Espresso Premium Event Category Class

Event Category Class

Posted: June 8, 2020 at 7:40 am


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/

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: publish

Updated by  Tony 1 month ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!