Problem styling current_page_item from wp_list_pages output
-
I have a problem with styling my wp_list_pages generated list.
The CSS for the current_page_item is:
.menu .current_page_item a { font-weight:bold; }
(The list with pages and sub pages is inside a div with a class named menu.)
This is the HTML output:
<div id="sidebar"> <ul id="sidebarwidgeted"> <li> <div class="menu"> <ul> <li class="page_item page-item-5 current_page_item"><a href="#">item 1</a> <ul> <li class="page_item page-item-7"><a href="#">item 1.1</a></li> <li class="page_item page-item-9"><a href="#">item 1.2</a></li> </ul> </li> <li class="page_item page-item-11"><a href="#">item 2</a></li> </ul> </div> </li> </ul> </div>
When you click a parent in the list, it gets the current_page_item class (good)
But also all children inherit the bold setting. (not good)When you click a child in the list, only that child is bold. (good)
I tried everything i can think of but i can’t get the child to stop inheriting the bold setting from his parent.
When i style the page_item class with font-weight:normal it overrides the current_page_item so everything gets that property.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Problem styling current_page_item from wp_list_pages output’ is closed to new replies.