changing color of events in WP FullCalander

Today I was working on a site that used WP events plugin and WP FullCalendar trying to change the colors of events. After a while, I found out how to change the default color of events by changing the default color of event categories and event taxonomies.

I also will discuss the tricky behavior with text color within this plugin

changing color of event categories

Usually the problem with the WP full calendar is that every event has #a8d145 like this:

event calander with green events
event calendar with the default color

As you can see all the events are green, this is due to an option in wp-admin which you can find at: events -> settings -> formatting -> event category -> default category color. these options look like the following:

default category color option in wp-admin

There could be a chance that you cannot find this option in the backend. This is because you have disabled event catagories, if you aren’t able to see this option you can go to events -> general -> general options -> enable categories to temporarily enable categories and then change the color after you have done this you can disable categories again and the default color will stay changed.

If you are a developer and you know REALLY REALLY what you are doing you can find this option under the key dbem_category_default_color in wp-options table and /wp-admin/options.php.

changing color of event taxonomies

Chaning the default color of event taxonomies is easy you go to events -> settings -> formatting -> event tags -> default tag color and change to color

adding color to a event taxonomy or category

You can also create an event category/taxonomy with a color so that every event with this cat/tax has the same color. You can do this in wp-admin in the sidebar under Events

cat/tax color picker

a note on text color

Now let’s say that you choose a light color such as baby blue(#89cff0). The text of the event will be hard to read because it is still white. You might also notice that some events do have dark text color. Currently, there is no way to change this in WP event manager as of version 6.4.6.4.

dark and light text color for events

But there is one way to change it without a CSS rule or the wpfc_events filter if you have event category enabled/

The textcolor for an event is defined by the WP events plugin and not WP FullCalendar. If you change the event color so it starts with #fff or #fffff that means when an event has a color of #fff23f the background color will be #777.

For the nerds reading this code that contains this logic looks like the following:

em-wpfc.php:181

finishing up

I hope this solved some issues that the shitty plugin docs don’t mention. If you have any questions or want to say thanks(which I really like). Go to my contact page to send me an email.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *