Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#12765 closed defect (bug) (duplicate)

Menu item link classes do not indicate "current" for parent item/s

Reported by: youngmicroserf's profile youngmicroserf Owned by: ryan's profile ryan
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Menus Keywords: menu item classes current
Focuses: Cc:

Description

In a hierarchical menu structure, it is often useful to be able to be able to differently style the current page's parent/grandparent/etc. differently from other parents. When testing a multi-level menu with the Twenty-Ten theme, "current-menu-item" is displayed in the selected page's class list, yet there is no attribute to identify the current selection's parent, grandparent.

Not sure if this is a bug or a feature. But I think it would be very useful to add this to the class list.

<div id="menu-menu-1" class="menu-header">
 <ul class="menu">
  <li id="menu-item-2754" class="menu-item menu-item-type-post_type  menu-item-object-page"><a target="_self" href="#">photos</a>

   <ul class="sub-menu">
    <li id="menu-item-2755" class="menu-item menu-item-type-post_type  menu-item-object-page"><a target="_self" href="#">Work Photos</a></li>
    <li id="menu-item-2761" class="menu-item menu-item-type-post_type  menu-item-object-page current-menu-item"><a target="_self" href="#">Holiday Photos</a></li>
   </ul>	
  </li>
 </ul>
</div>

Change History (3)

#1 @youngmicroserf
14 years ago

  • Milestone changed from Unassigned to 3.0

#2 @youngmicroserf
14 years ago

OK, I was first ;), but I think this is a duplicate of http://core.trac.wordpress.org/ticket/12812, and there's more input there already...

#3 @nacin
14 years ago

  • Milestone 3.0 deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.