Title: How To Add Custom Menu Classes Using Walker Function
Last modified: August 20, 2016

---

# How To Add Custom Menu Classes Using Walker Function

 *  [iversoncreative](https://wordpress.org/support/users/iversoncreative/)
 * (@iversoncreative)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/how-to-add-custom-menu-classes-using-walker-function/)
 * How would I utilize a Walker ([http://codex.wordpress.org/Function_Reference/wp_nav_menu#How_to_add_a_parent_class_for_menu_item](http://codex.wordpress.org/Function_Reference/wp_nav_menu#How_to_add_a_parent_class_for_menu_item))
   to add a class to the sub menu? My menu code needs to look like this (stripped
   down to just what I need to add):
 *     ```
       <ul>
           <li class="dropdown"><a href="#">Parent Page</a>
               <ul class="dropdown-menu">
                   <li><a href="#">Sub Page</a></li>
               </ul>
           </li>
       </ul>
       ```
   
 * Any insights would be greatly appreciated!
 * – Patrick

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * (@wpthemes777)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/how-to-add-custom-menu-classes-using-walker-function/#post-2974805)
 * Try this
 * [http://thesis-blogs.com/add-a-custom-class-to-each-item-in-the-wordpress-menu/](http://thesis-blogs.com/add-a-custom-class-to-each-item-in-the-wordpress-menu/)
 *  Thread Starter [iversoncreative](https://wordpress.org/support/users/iversoncreative/)
 * (@iversoncreative)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/how-to-add-custom-menu-classes-using-walker-function/#post-2974806)
 * Nope. Not quite. That only allows you to add a class to the `<li>` element, and
   not the parent `<ul>` element.
 *  [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * (@wpthemes777)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/how-to-add-custom-menu-classes-using-walker-function/#post-2974808)
 * Then maybe one of these
 * [http://pastebin.com/DVEcci3e](http://pastebin.com/DVEcci3e)
 * [http://wordpress.stackexchange.com/questions/3014/highlighting-wp-nav-menu-ancestor-class-w-o-children-in-nav-structure](http://wordpress.stackexchange.com/questions/3014/highlighting-wp-nav-menu-ancestor-class-w-o-children-in-nav-structure)
 *  Thread Starter [iversoncreative](https://wordpress.org/support/users/iversoncreative/)
 * (@iversoncreative)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/how-to-add-custom-menu-classes-using-walker-function/#post-2974899)
 * No. I need to apply a tag to the child `<ul>` element. Neither of those achieves
   that.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How To Add Custom Menu Classes Using Walker Function’ is closed to new
replies.

## Tags

 * [Walker](https://wordpress.org/support/topic-tag/walker/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [iversoncreative](https://wordpress.org/support/users/iversoncreative/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/how-to-add-custom-menu-classes-using-walker-function/#post-2974899)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
