• For this website (https://alturl.com/6eu3o) I’m trying to let wordpress highlight the current parent + current child menu item. Its working for the parent menu item on the other pages, but somehow for the child pages it only highlights the current child, iso both the child and parent.

    Css:

    #outheader #header #navigation #menu #nav ul li.current_page_parent a {
    	background-image: url(../images/achtergrond/headerinfo.png);
    	background-repeat: repeat-x;
    }
    
    #outheader #header #navigation #menu #nav ul li.current_page_item a {
    	background-image: url(../images/achtergrond/headerinfo.png);
    	background-repeat: repeat-x;
    	}
    #outheader #header #navigation #menu #nav ul li.current_page_item ul li a {
    	background-image: none;
    }

    And if we are looking at the child’s child pages (https://tinyurl.com/c4nc4oo) we can see that nothing in the menu works.

    Whats going wrong here?

Viewing 4 replies - 1 through 4 (of 4 total)
  • you are targeting the wrong level of unordered list tags;

    try:

    #outheader #header #navigation #menu ul#nav li.current_page_parent a {
    Thread Starter lerrie

    (@lerrie)

    Thank you, I’ve changed the css + added the current_page_ancestor, but now the menu (https://alturl.com/6eu3o) is highlighting all child pages.

    Css:

    #outheader #header #navigation #menu ul#nav li.current_page_parent a {
    	background-image: url(../images/achtergrond/headerinfo.png);
    	background-repeat: repeat-x;
    }
    
    #outheader #header #navigation #menu ul#nav li.current_page_item a {
    	background-image: url(../images/achtergrond/headerinfo.png);
    	background-repeat: repeat-x;
    	}
    #outheader #header #navigation #menu ul#nav li.current_page_ancestor a {
    	background-image: url(../images/achtergrond/headerinfo.png);
    	background-repeat: repeat-x;
    	}

    for those pure formatting issues, try asking at a css forum like https://csscreator.com/forum

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Lerrie, duplicating threads is not tolerated here. If you’re unsatisfied with the scope of support provided by these forums, use the recommended CSS forum by Alchymyth or consider hiring someone.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Highlight both partent and child in menu’ is closed to new replies.