Support

Home Forums Events Calendar Add-on Category Colors

Category Colors

Posted: November 29, 2013 at 10:04 pm


TRT

November 29, 2013 at 10:04 pm

Hi friends,

I’d like to add an event with 2 categories (Category A, B). I have assigned Cat A with specific colors, and B with no specific colors. However when I add the event to calendar, it shows Category B color (default calendar color) instead of Category A’s color. How do i put Category A’s color as a priority?

Thanks!

  • This topic was modified 10 years, 5 months ago by  Josh. Reason: moving to calendar forum


Josh

  • Support Staff

December 2, 2013 at 1:23 pm

Hi there,

You can make category A’s colors a priority by adding a few lines of CSS to your custom stylesheet. For example, if category A’s unique identifier is “category-a” then something like this can be added to make these events have a red background with white text:

.category-a,
.category-a a {
 color: #FFF;
 border-color: red !important;
 background-color: red !important;
}


TRT

December 6, 2013 at 9:16 am

Hi Josh,

Does it mean that I do not have to set a color at the “Event Categories” to make it work?

Our events will require the admins to select 2 categories. 1) The type of event. 2) Whether the event is free or premium.

There are 5 types of event: A,B,C,D,E

I would love to make these 5 events of priorities in color than whether it is free/premium. Will adding 5 of the above-mention work? Or is there another way around it?

Thanks!


TRT

December 9, 2013 at 5:55 am

Hi,

The CSS code doesnt seem to work.. I have set 2 categories that are of higher priority, mutually exclusive.

Site is * redacted *

The CSS code i used is:

<code>.free-event
.free-event a {
color #FFF;
border-color: #33b408 !important;
background-color: #33b408 !important;
}

.premium-event
.premium-event a {
color #FFF;
border-color: #2257ce !important;
background-color: #2257ce !important;
}</code>

Thanks!


TRT

December 9, 2013 at 5:57 am

I’ve added 2 examples of events on 31 December 2014. Please take a look at the event on the calendar. (URL above)

One should be in green and other should be in blue. But both were in the default blue color even when custom css was added.


Josh

  • Support Staff

December 9, 2013 at 10:50 am

Hi there,

I looked, but do not see events for Dec 31st. Also, I don’t see the custom styles loading onto the page. You might try adding the custom styles to the child theme’s style.css, since it appears that your active WordPress theme is loading up an additional stylesheet here:

* redacted *


TRT

December 10, 2013 at 5:27 am

Hi Josh,

The 2 sample event is placed in 2014, 31 Dec. Not in year 2013. Sorry if I did not make it clear.

Anyway it’s weird that the CSS didn’t load up. I customised other CSS onto the Custom CSS plugin and they worked perfectly.


Tony

  • Support Staff

December 10, 2013 at 7:39 am

Hi there,

Your custom css (took me a little while to find) is loading in a rather unusual way. * redacted *

The sccss_style-css line is the custom css. Although the browser is not recognizing it as it it not loading correctly.

I would suggest using the My Custom CSS plugin, copying your exising css rules into that and removing what I assume is the ‘simple-custom-css’?

That seems why the calendar is not displaying your custom colors.


TRT

December 10, 2013 at 5:24 pm

Hi Tony,

Thanks for the response. I’ve installed My Custom CSS, but it is still not working.

This was what added to the My Custom CSS plugin:
<pre class=”brush: css; gutter: true; first-line: 1; highlight: []; html-script: false”>.free-event
.free-event a {
color #FFF;
border-color: #25c51b !important;
background-color: #25c51b !important;
}

.premium-event
.premium-event a {
color #FFF;
border-color: #2257ce !important;
background-color: #2257ce !important;
}


Dean

December 11, 2013 at 12:54 am

Hi,

There is a typo in your code, each rule must have a comma around it unles sit is the last one, like this:

.free-event,
.free-event a {

An example – http://d.pr/i/RMBm


TRT

December 11, 2013 at 1:15 am

Hey Dean,
Ah now I see what’s wrong! It’s working now, thanks!

Appreciate your help too, Josh & Tony 🙂


Dean

December 11, 2013 at 2:26 am

Great stuff!

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