WordPress.org

Ready to get started?Download WordPress

Forums

Genesis Subpages as Secondary Menu
[resolved] Highlight parent using submenu (4 posts)

  1. glazyr
    Member
    Posted 2 years ago #

    I am using Genesis subpages as secondary menu. I use Tapestry and genesis. I wish to highlight the parent "Tjänster" when one of the children is selected.

    http://sumaconsulting.se/tjanster

    But it does not seem to work.

    http://wordpress.org/extend/plugins/genesis-subpages-as-secondary-menu/

  2. flamenco
    Member
    Posted 2 years ago #

    Hi,
    I see that for now you solved the problem by forwarding to the first link under Tjanster. :-)

    When I've seen this type of issue before, it has been because a Custom Post Type has been added to a menu. Those will not show up as "current" items in the menu code. If this is true in your case, here's some info about how to add that:

    http://oikos.org.uk/2011/12/tech-notes-highlighting-current-menu-items-for-post-type-archives/

    By the way, this is a WordPress problem that has nothing to do with Genesis per se.

    Cheers, Dave

  3. Bill Erickson
    Member
    Plugin Author

    Posted 2 years ago #

    Sorry for missing this.

    This is actually completely doable, you just need to change your stylesheet. WordPress applies a class of "current-menu-ancestor" to the parent page when on subpages. So open up your stylesheet, find the style responsible for the "active state" in the menu, and add that as a class.

    Example:

    #nav li a:hover,
    #nav li.current-menu-item a,
    #nav li.current-menu-ancestor a {
    background: #ff0000;
    }
  4. glazyr
    Member
    Posted 2 years ago #

    The link above is not correct. Now this is the correct one: http://sumaconsulting.se/tjanster/hr-och-organisation

    To solve the problem I had to put HR och Organisation, Försäljning and Chefskap as children to HR och Organisation. Rename the menuitem in the custom menu and set display: none; for the pages. In combination with "Genesis subpages as secondary menu" I couldn't see any other solution.

    It seems that when you use "Genesis subpages as secondary menu" the pages HR och Organisation, Försäljning and Chefskap does not become ancestors and the suggestion from Bill don't work. At least when I tried a month ago :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic