Highlight parent page link without highlighting all children
-
I’m having difficulty getting a nested menu to highlight only the Parent link and the current page link within a list of pages. I’m suspecting it has something to do with inheritance, but haven’t been able to discover a solution to the problem after much trial and error and googling.
The code below does highlight the parent page, but also highlights every single child page, not just the active one. I would just like the parent page and current page highlighted
HTML:
<div id=”nav”>
-
<li class=”page_item page-item-71 page_item_has_children current_page_ancestor current_page_parent”>Exhibits
<ul class=’children’>
<li class=”page_item page-item-73 current_page_item”>Current Exhibits
<li class=”page_item page-item-75″>Past Exhibits
<li class=”page_item page-item-77″>Upcoming Exhibits<li class=”page_item page-item-44″>Artists
<li class=”page_item page-item-79″>Catalogs
<li class=”page_item page-item-81″>Gallery
</div>CSS:
#nav ul li.current_page_parent a {
text-decoration:none; color: #FFF; font-weight:500;
}
#nav li.current_page_item a {
text-decoration:none; color: #FFF; font-weight:500;
}Any ideas or suggestions?
-
Hi there, the site on your username account is using Kubrick and hasn’t had any activity since 2008. Can we have a link to the site you are talking about please?
-
-
Hi @, it looks like you are using WordPress but you are not hosted here at WordPress.com. For self-hosted WordPress sites such as yours, I would suggest asking for help from the theme author directly or ask in the volunteer-based WordPress.org Themes and Templates forum.
For general questions on self-hosted WordPress.org installations, visit http://wordpress.org/support/.
The differences between WordPress.com and WordPress.org.
I did look at your site, but give you do not currently have any submenus off of any of the top level menu items, I could not test solutions. I would suggest adding some submenu items so that people have something to loo at and then post in the theme author’s support or in the WordPress.org Themes and Templates forum (link above).
- The topic ‘Highlight parent page link without highlighting all children’ is closed to new replies.