Posted: May 21, 2018 at 8:21 am
|
Hi, Is there a way of setting an event that has multiple categories to have a primary category as you can with “standard” WordPress posts? The reason I want to be able to do this is so that I can display events in our calendar with the the colours that have been assigned in categories. Currently it is taking on the colours of one of the other categories that are assigned to the event. For example, this event has two categories https://www.impactmh.org.uk/courses/you-programme-enrolment-dunstable-over-50s-for-september-2018/ They are: – You Programme Sign-Up On the calendar interface, it looks like the You Programme Sign-Up category colours are taking precedence https://www.impactmh.org.uk/course-calendar/?event_category_id=you-programme-over-50s-sign-up#espresso_calendar – there is an event on August 28th, as an example. This should be green background. Hope that makes sense. Thanks Phil |
Hi Phil, You can show events from a specific category in the calendar by using a shortcode. Something like this: Just replace “your_category_id” with the category id you want displayed. Does that help? |
|
|
Hi Seth, The events from the category display OK by default. However as this particular one has two categories, I’m trying to force the colour coding of one particular category. In this case – You Programme Over 50s Sign Up should be green and not be using the brown colour coding of the other category that it uses – You Programme Sign-Up https://screencast.com/t/aILY6Kw0GLlS Thanks Phil |
Hi Phil, The only reliable way to override the background colour when there are two or more categories attached to an event is add CSS. For example, you can add the following CSS to your site to set the green background to the events that have both You Programme Over 50s Sign Up & You Programme Sign-Up:
If you do not have a custom stylesheet to add CSS to, you can add the CSS to the WordPress dashboard’s Appearance → Customize → Custom CSS panel. |
|
|
Thanks Josh, That works a treat. I have two CSS rules now as follows: /* calendar category colours override */ #espresso_calendar .you-programme-for-the-over-50s { I tried to combine them as follows /* calendar category colours override */ to try to make it a bit neater, but that didn’t work. Have I got the syntax wrong on the selectors? Thanks Phil |
|
Actually, Josh, I think I figured it out. I was missing the second id /* calendar category colours override */ Which works a treat. Thanks for your help. Regards Phil |
The support post ‘Setting A Category As A Primary Category’ 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.