Forums

Navigation Menu - Subpage current_page_item CSS (3 posts)

  1. jtovar
    Member
    Posted 1 year ago #

    Greetings,

    I am customizing a theme for a client and wondering about Subpages and the current_page_item function.

    When on this page, you can see that the Photos menu item responds to the corresponding CSS class -
    http://www.checkyo.staticka.com/photos/

    Yet when on a subpage, it does not.
    http://www.checkyo.staticka.com/photos/photos-2006/

    What do I need to do to have it behave properly, having the Photos link styled per the current_page_item class when on subpages? I've read a few WordPress codex pages but frankly am not savvy enough with the functions.php file to know how to achieve this.

    http://codex.wordpress.org/Dynamic_Menu_Highlighting
    http://codex.wordpress.org/Conditional_Tags

    Thanks in advance!
    - Jeff Tovar

  2. DigitalSquid
    Member
    Posted 1 year ago #

    On your subpage, the current_page_item class in the menu is replaced by current_page_ancestor and current_page_parent.

    Instead of messing around with the functions.php you could probably just change your CSS to:

    .menu ul li.current_page_item a,
    .menu ul li.current_page_parent a {
    	color: #eae1d8;
    }

    And get the same result.

  3. jtovar
    Member
    Posted 1 year ago #

    Ahhh, I was way over-thinking it. Thanks for your help, works like a charm!

Topic Closed

This topic has been closed to new replies.

About this Topic