Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#15282 closed enhancement (invalid)

wp_nav_menu now displays menu depth

Reported by: edward mindreantre Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Menus Keywords: reporter-feedback
Focuses: Cc:


Adds sub-menu-depth-1 and menu-item-depth-2 classes to the ul and li classes when displaying wp_nav_menus.

This is useful for fanciful jquery manipulation of the menu.

Attachments (1)

nav-menu-template.16095.diff (212 bytes) - added by edward mindreantre 8 years ago.

Download all attachments as: .zip

Change History (7)

#1 @nacin
8 years ago

  • Keywords menu wp_nav_menu depth template removed

I don't see why this is needed, at least based on the use case.

Depth can be targeted with li, li li, etc. And even better via jQuery.

#2 @westi
8 years ago

  • Keywords reporter-feedback added

#3 @edward mindreantre
8 years ago

As far as I know, saying ul ul in the css will target ALL under-ul tags of the first ul.

I know of no css selector that selects the first or second depth

#4 @filosofo
8 years ago

How about

ul.menu > li > ul


ul.sub-menu > li > ul


#5 @edward mindreantre
8 years ago

Can't reproduce the way you say.

ul > li

nails all the lis under the ul.

#6 @nacin
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

This is doable with proper selectors, including child selectors and first/last pseudo-selectors.

Note: See TracTickets for help on using tickets.