Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#15529 closed enhancement (duplicate)

Add class name to first menu item in wp_nav_menu()

Reported by: johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Template Keywords: has-patch needs-testing
Focuses: Cc:


If the theme displays the output of wp_nav_menu() horizontally and wants to put a separator between menu items, then usually something like a left border is used.

To remove this separator from the left hand side of the menu, the first item will often have the border or background image removed by using the ':first-child' CSS pseudo class. This is all well and good but the ':first-child' selector isn't supported in IE6.

If we added a 'first-child' or 'first-menu-item' class to the first menu item then it'd be easier for themers to use this property and maintain support for IE6.


Attachments (1)

15529.patch (2.2 KB) - added by johnbillion 5 years ago.

Download all attachments as: .zip

Change History (3)

5 years ago

#1 @johnbillion
5 years ago

  • Keywords has-patch needs-testing added

Patch. I think this covers it.

#2 @nacin
5 years ago

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

Duplicate of #14250 and at least one other, I think. We don't wish to do this. There's code in that ticket that can do this on a filter.

Note: See TracTickets for help on using tickets.