Support » Plugin: The Events Calendar » [Plugin: The Events Calendar] how to add different color text in calendar view for all subcategories

  • Resolved arpitap

    (@arpitap)


    Can anyone tell me how differentiate all the subcategories for root Events category using different color text for each category in Calendar view?

    Any help would be appreciated.

    Thanks in advance.

    Arpita

Viewing 15 replies - 1 through 15 (of 19 total)
  • Amazing Event Calendar Plugin.

    Would love to know how to change the coloring for each category.

    I’m aware the #tec-content in events.css is customizable, but would love to assign different colors for each sub-event category.

    do you want same as below link? If yes, then I can give you instructions.

    I have solved this problem already.

    http://professionalplanner.com.au/?cat=949&eventDate=2010-11&eventDisplay=month

    yes, that would be great! was this done in your events.css?

    Just following up. Would you be able to to provide instructions to solve this? I’d be greatly appreciative. Thank you!

    I’m interested in this exact issue as well. Did you post the answer somewhere?

    Thanks!

    I will post the answer by end of this week for sure.

    I am running busy somewhat that’s why not able to post it, but will do it by end of this week.

    Cheers,
    Arpita

    Great! Thank you Arpita!

    Thanks arpitap! Look forward to it.

    I made changes in display_day function which is in table.php file.

    the file is under views folder in the plugin.

    at line 120:

    in place of

    <div id=’event_<?php echo $eventId; ?>’ class=”tec-event
    <?php
    foreach((get_the_category()) as $category) {
    echo ‘cat_’ . $category->cat_nickname . ‘ ‘; //Arpita
    }
    ?>
    “>

    I replaced it with :

    <div id=’event_<?php echo $eventId; ?>’ class=”tec-event
    <?php
    foreach((get_the_category()) as $category) {
    echo ‘cat_’ . $category->cat_name . ‘ ‘;
    }
    ?>
    “>
    <?php
    foreach((get_the_category()) as $category) {
    if($category->cat_name == ‘Professional Planner Events’)
    {
    ?>
    ” style=”color:#990066;”><?php the_title(); ?>
    <? }
    else if($category->cat_name == ‘Media Partner Events’)
    {
    ?>
    ” style=”color:#0099CC;”><?php the_title(); ?>
    <? }
    else if($category->cat_name == ‘Industry Events’)
    {
    ?>
    ” style=”color:#339933;”><?php the_title(); ?>
    <? }
    else if($category->cat_name == ‘Webinars Events’)
    {
    ?>
    ” style=”color:#CC0000;”><?php the_title(); ?>
    <? }

    }
    ?>

    basically what it is doing is getting sub category name and based on that subcategory, it will display different color title.

    I don’t think this is proper way to do it but still it is working fine for me.
    Let me know if you need anymore help in this from me.

    Arpita

    Thank Arpita. Looks great. The only issue I have is that the code is duplicating my event entry. I only want my “Away-Games” to be a different color.
    Here’s my code:
    <div id=’event_<?php echo $eventId; ?>’ class=”tec-event
    <?php
    foreach((get_the_category()) as $category) {
    if($category->cat_name == ‘Away-Game’)
    {
    ?>
    ” style=”color:#999999;”><?php the_title(); ?>
    <? }

    }
    ?>

    **Any feedback would be great!**

    Thanks arpitap! This did the trick! Much appreciated!!!

    I have four categories under Events

    Theatre, Music, Art, Dance

    But when I use the code it shows the — ” style=”color:#123456;”> in addition to properly changing the color

    Am I missing something?

    Here is the code I used based on @arpitap. Hopefully this helps you.

    <div id='event_<?php echo $eventId; ?>' class="tec-event
    <?php
    foreach((get_the_category()) as $category) {
    echo 'cat_' . $category->cat_name . ' ';
    }
    ?>
    ">
    <?php
    foreach((get_the_category()) as $category) {
    if($category->cat_name == 'Academic Events')
    {
    ?>
    <a href="<?php the_permalink(); ?>" style="color:#ff0000;"><?php the_title(); ?></a>
    <? }
    else if($category->cat_name == 'Art Events')
    {
    ?>
    <a href="<?php the_permalink(); ?>" style="color:#00cc1f;"><?php the_title(); ?></a>
    <? }
    else if($category->cat_name == 'Athletic Events')
    {
    ?>
    <a href="<?php the_permalink(); ?>" style="color:#ffaa00;"><?php the_title(); ?></a>
    <? }
    else if($category->cat_name == 'Corporate Events')
    {
    ?>
    <a href="<?php the_permalink(); ?>" style="color:#1100ff;"><?php the_title(); ?></a>
    <? }
    else if($category->cat_name == 'Alumni Events')
    {
    ?>
    <a href="<?php the_permalink(); ?>" style="color:#ea00ff;"><?php the_title(); ?></a>
    <? }
    
    }
    ?>
    	<div id='tooltip_<?php echo $eventId; ?>' class="tec-tooltip" style="display:none;">

    Thanks,

    I’ll give it a shot.

    Have you had a problem with event list?

    No. you?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘[Plugin: The Events Calendar] how to add different color text in calendar view for all subcategories’ is closed to new replies.