Targeting ancestor in menu in Genesis Sample Theme

Community Forums Forums Design Tips and Tricks Targeting ancestor in menu in Genesis Sample Theme

This topic is: not resolved

Tagged: , ,

This topic contains 3 replies, has 2 voices, and was last updated by  Sridhar Katakam 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #59683

    budskab
    Participant
    Post count: 2

    Hi

    I’m doing some customizations to the genesis sample theme.

    I really want to target the menu, when being on one of the child sites, so that the menu is highlighted in the same way that if it was a current-menu-item.

    I’ve formerly done this (prior Genesis 2.0, with current-menu-ancestor or current-page-ancestor and such.

    I’ve tried all of these combinations:

    .nav-primary .current-page-ancestor > a,
    .nav-primary .current-post-ancestor > a,
    .nav-primary .current-menu-ancestor > a

    I wasn’t sure about if the “greater than” was maybe the trouble, so I also tried without… but didn’t work either

    How come it doesn’t work anymore? And, most importantly, how is it done now?


    #59694

    Sridhar Katakam
    Participant
    Post count: 926

    There are several possible CSS selectors. Here is one:

    .genesis-nav-menu > .menu-item.current-page-ancestor > a

    Sample CSS:

    .genesis-nav-menu > .menu-item.current-page-ancestor > a {
        color: #FFFFFF;    
    }

    #59730

    budskab
    Participant
    Post count: 2

    Hmm… tried that ..

    The original code, targeting when on a current page looks like:

    .nav-primary .current-menu-item > a {
    	color: #E60E0E;
    	background-color: #fff;
    }

    This works fine for “Frontpage > Page”
    But your suggestion didn’t highlight when on : “Frontpage > Page > Subpage”

    Have any other suggestions?

    Thanks in advance
    Mark


    #59731

    Sridhar Katakam
    Participant
    Post count: 926

    The CSS I suggested is working on my test site (on localhost).

    Can you provide the URL of your site in question?


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.