- This topic has 5 replies, 2 voices, and was last updated 5 years, 6 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘How do I …’ is closed to new topics and replies.
Events Made Easy › Forums › How do I … › Add event category to body class
Tagged: body class, category
I want to be able to implement style changes for a particular category of event in the single event page and it’d be great if I could just add the category to the body class, but I’m not sure if it’s possible.
Or maybe I can add the event category to this function and do it that way and just call a different header for that category.
eme_is_single_event_page()
Can you help?
You can add enclosing div’s to the single event format (and add the class to the div then).
Thanks for responding Franky.
Yes your suggestion can wrap the event content with a category class which is okay and I’ve done that with the event list, but I actually want to change the main page header and all the colours for one of the categories so I was hoping to say if eme_is_single_event_page() and the category / taxomony is *Event category* then get header(‘2’)
Or adding the event category to the main body class function would let me achieve what I need as well. Can’t get that to work.
Or even having a category specific page template within the theme. But I don’t think that can work with the way the events are coded.
Are any of those solutions possible? I’ve tried various ways that work with other post-types but I can’t get it to work. Am I wasting time on something that can’t be done?
Well, it is easier than that: when editing an event, you can select the page template to be used (at the bottom right: “Template”). That is a list of your theme templates, so you can add templates to your liking and use those 🙂
(edited: “editing a template” to “editing an event”)
Doh – talk about over complicating things!
Thanks Frankie – how did I miss that?
Sometimes even I forgot that I implemented that one 🙂