Home › Forums › Calendar Products › Events Calendar PRO › Add event's category to css class in week view
- This topic has 11 replies, 4 voices, and was last updated 7 years, 1 month ago by Adage.
-
AuthorPosts
-
January 21, 2017 at 9:34 pm #1221980AdageParticipant
Hello,
In order to have different colors for different events’ categories, I wonder :
1- what file I should edit ;
2- how may I be sure updating the plugin won’t erase my edits ;
3- what function could I use to call the categories of the event ?Thank you very much.
January 21, 2017 at 9:53 pm #1221982AdageParticipantSeems built in allready ^^
Now I wonder : how may I also add the parent category of the event’s categories ?
Thanks.January 22, 2017 at 6:21 pm #1222119GeorgeParticipantHey @Adage!
Thanks for reaching out. When it comes to category colors, there are some built-in abilities to modify the colors of events—but there’s also an unofficial free plugin called The Events Calendar: Category Colors, which you can download here → https://wordpress.org/plugins/the-events-calendar-category-colors/
↑ This is an unofficial plugin made by our awesome community member, Andy Fragen.
Next, you ask the following:
Now I wonder : how may I also add the parent category of the event’s categories ?
↑ Can you clarify what you’re asking for here? I apologize for my misunderstanding! I just want to make sure I totally understand your question so I can best help out. 😀
Cheers,
GeorgeJanuary 23, 2017 at 3:21 am #1222256AdageParticipantHello and thank you,
I have a parent category “Music” with children categories “Rock”, “Jazz”.
I need to add the parent category “Music” to the CSS in order to be able to style it.
How may I do that ?
Thank you.January 24, 2017 at 8:12 pm #1223321GeorgeParticipantHey @Adage,
The categories should already be part of events. You can tell on your site by checking out its HTML source.
To make it easier to do this, definitely check out a [free!] tool like Firebug if you use FireFox, or the Developer Tools for either Safari or Chrome. They have “Inspector” tools that let you zoom right over the element whose CSS classes you want to see.
Once you have these tools on your site, view your Week View or any other events view and use these tools to “inspect” an event. You’ll see all its class names and can go from there.
Cheers!
GeorgeJanuary 24, 2017 at 11:27 pm #1223429AdageParticipantHello,
I allready use the inspector, and that is precisely how I discovered the parent categories are not added.
I think this is because the parent categories are not checked : only children categories are checked.
I need the parent category to appear in classes even if it is not checked by itself.
How can I set this up ?
Thank you.January 25, 2017 at 9:08 am #1223774GeorgeParticipantHey Adage,
Thanks for clarifying the problem here, and I’m sorry for my misunderstanding it thus far! What you describe here is the problem:
I think this is because the parent categories are not checked : only children categories are checked.
☝️This is exactly correct: Events only belong to “checked” categories, and the only categories that get added as HTML classes to events are the categories they belong to.
There is unfortunately no way to do modify this behavior without some extensive custom coding. 🙁 We unfortunately cannot help with that, as elaborated upon here.
However, I will try to write some custom code to make this happen because there may be a simple way to do this.
I apologize in advance for the time it will take me to come up with this custom code, if I can at all: I will have to tinker a bit and test it out and such.
But sit tight! I will post an update soon with news about whether I can pull this off with custom code or not.
— George
January 25, 2017 at 10:56 am #1223832AdageParticipantThank you very much !
I sit tight then !January 26, 2017 at 9:16 am #1224498GeorgeParticipantStill working on this, @Adage! Thanks for your patience—I should have an update for you by the end of today.
Cheers,
GeorgeFebruary 16, 2017 at 9:01 am #1238811GeorgeParticipantHey @adage, very sorry for the delayed reply. I have tried to replicate these issues but what I have consistently found is that in all calendar views our plugins actually do list child event categories and even grandchild event categories without issue!
March 10, 2017 at 8:35 am #1252393Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Add event's category to css class in week view’ is closed to new replies.