• Resolved GMah

    (@gmah)


    Hi all!

    Just started using WordPress and so far I’ve been able to get things working the way I want, except for this little thing :

    My site : http://www.sciencefficient.com use a child theme of WordPress Twenty Eleven Theme. I built the menu bar using the Menu option under the appearance preference panel. Every menu items are pages with the exception of Reviews, which is a category link. Every menu item behave as expected when you hover over them (that is a blue gradient background).

    If you click on any item and go to the corresponding page the menu will display blue text to show the active menu item. The problem is that the blue text does not appear for the Reviews section so this must due to the fact that it’s a category instead of a page?!?! I’ve tried building the same menu using the same sub-categories but making Reviews a page instead of a category and that way it behave as expected. But what I truly want is to make review a link to the category and get it to have the blue text when active, but I’m clueless on how to do this. Other option would be to create a page and get the page template to display the posts with the category review, but again I get lost in the PHP…

    Any help? It can’t be that hard, it’s simply displaying active section (when it’s a category instead of a page) with blue text but I really don’t see the solution

Viewing 6 replies - 1 through 6 (of 6 total)
  • sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Find this in your child style.css file

    #access .current_page_item > a, #access .current_page_ancestor > a {
    color: #1D97F2;
    font-weight: bold;
    }

    and change it to this

    #access .current_page_item > a, #access .current_page_ancestor > a, .current-menu-item a {
    color: #1D97F2 !important;
    font-weight: bold;
    }

    Thread Starter GMah

    (@gmah)

    Thanks, made a copy/paste of the line of codes, it works but not completely… When I select directly reviews, it does indeed get the blue text, but if I click on a item of the sub-menu the sub-menu item is blue but not the word review that appear in the menu. I’m sorry as I’m aware that my previous message lacked precision on this point…

    Thanks anyway, it’s a step in the right direction!

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Gaaahhh! I think I got it. Replace what I had given you with this and see if that works.

    #access .current_page_item > a, #access .current_page_ancestor > a, #access .current-menu-item > a, #access .current-menu-ancestor > a {
    color: #1D97F2;
    font-weight: bold;
    }
    Thread Starter GMah

    (@gmah)

    Works flawlessly!!!! Thank you, I owe you BIG time! When you think about it the two new class selectors make perfect senses but I never saw any of them before !

    Thanks again!

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    You’re welcome. Made sense to me also, but it took a bit to get it working. I think Firebug was having fit or something. I reloaded the page, disabled and reenabled Firebug and then the code worked.

    Thread Starter GMah

    (@gmah)

    I should really give a try to FireBug, to this day I’ve been using Safari inspect element which also gives a lot of info. To be honest I didn’t know that one item can have multiple class at the same time (I thought they were limited to one just like id) so to me it appeared like a huge class since didn’t know that a space meant that this was a new class… Still learning that’s a great thing.

    Thanks again

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Menu with categories : Active category not showing’ is closed to new replies.