Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    There's no point in going to the extent of adding a custom Walker when the Walker_Nav_Menu class already exposes the appropriate filter (nav_menu_link_attributes) for you to add custom attributes. A custom walker for this purpose just adds an additional layer of complexity. Commented Nov 12, 2016 at 8:30
  • Thanks so much! This worked as well as the other solutions provided however I enjoyed the detail of this and find it useful! Commented Nov 12, 2016 at 23:36