• i’m using a costumized version of navigation header present in samk’s pixel theme.
    resulting in a basic list with all parent categories in line in the header.

    When you click on one of these main categories
    the subcategories listed under this parent appear in the right sidebar.

    As I need to have parent category highlighted AND in the color of my choice when this subcategory is browsed, I started using the current-cat and current-cat-parent classes. like this :
    (in style.css)
    to highlight parent category item :

    /* bold nav for parent cat */
    
    #nav li.current-cat-parent a {
     font-size: 34px;
     font-family : Impact;
     padding : 0 0 0 0;
     }
    
    #nav li.current-cat a {
     font-size: 34px;
     font-family : Impact;
     padding : 0 0 0 0;
     }

    and to colour PARENT category item :

    /* Coloring the menu items in header nav*/
    
    #nav li.current-cat.cat-item-4 a {
     color:#0098de;
     }
    
    #nav li.current-cat.cat-item-3 a {
     color:#e54166;
     }
    
    #nav li.current-cat.cat-item-8 a {
     color:#e54166;
     }
    
    #nav li.current-cat.cat-item-5 a {
     color:#863981;
     }
    
    #nav li.current-cat.cat-item-6 a {
     color:#f8e704;
     }

    the highlighting part works fine for all cats and subcats..
    but obviously the color part only works for the parent category directly clicked on header….

    I couldn’t find a way to have parent item get coloured when subcategory is selected IN THE SIDEBAR.

    After thorough researches, i figured out I could try to set up a style.css.php with conditional tags but

    1. this is very hasardous as i am VERY bad at coding.. have never tried something like this and have no clue how style.css.php behaves.

    2. i don’t even have a clue how to do it !

    would there be a way to have main cats in header coloured after their subs in sidebar is selected without any use of php ?

    any tip would be extremely appreciated !

    Jean

  • The topic ‘NAV problem : trying to colour category when subcategory is choosen.’ is closed to new replies.