Opened 14 years ago
Closed 14 years ago
#16763 closed enhancement (worksforme)
nav-menu-template.php Does Not Add $class_names to Anchor Tags, Preventing Custom Theming
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 3.1 |
Component: | Menus | Keywords: | |
Focuses: | Cc: |
Description
The $item_output portion of wp-includes/nav-menu-template.php that defines what the a tag will contain doesn't include a class attribute, whereas the ul tag does. This prevents customized theming (e.g. colors, images before/after, etc.) of the menu links. This can be modified by appending $class_names to $item_output's <a line, i.e.
$item_output .= '<a'. $attributes .'>';
becomes
$item_output .= '<a'. $attributes . $class_names .'>';
Change History (3)
Note: See
TracTickets for help on using
tickets.
But the wrapping <li> is full of class names and also has a filter for adding your own, so your anchors can be targetted with li.the-class-you-want a {}
A.