Add event's category to css class in week view

Home Forums Calendar Products Events Calendar PRO Add event's category to css class in week view

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1221980
    Adage
    Participant

    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.

    #1221982
    Adage
    Participant

    Seems built in allready ^^
    Now I wonder : how may I also add the parent category of the event’s categories ?
    Thanks.

    #1222119
    George
    Participant

    Hey @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,
    George

    #1222256
    Adage
    Participant

    Hello 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.

    #1223321
    George
    Participant

    Hey @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!
    George

    #1223429
    Adage
    Participant

    Hello,
    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.

    #1223774
    George
    Participant

    Hey 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

    #1223832
    Adage
    Participant

    Thank you very much !
    I sit tight then !

    #1224498
    George
    Participant

    Still working on this, @Adage! Thanks for your patience—I should have an update for you by the end of today.

    Cheers,
    George

    #1238811
    George
    Participant

    Hey @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!

    #1252393
    Support Droid
    Keymaster

    Hey 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

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Add event's category to css class in week view’ is closed to new replies.