Title: wp_nav_menu not rendering menu_class correctly
Last modified: August 21, 2016

---

# wp_nav_menu not rendering menu_class correctly

 *  [reddo](https://wordpress.org/support/users/reddo/)
 * (@reddo)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/wp_nav_menu-not-rendering-menu_class-correctly/)
 * Here is my code in the header
 *     ```
       <nav class="col-md-9" role="navigation">
         <?php wp_nav_menu(
           array(
             'theme_location'  => 'navigation',
             'menu'            => '',
             'container'       => false,
             'container_class' => 'menu-{menu slug}-container',
             'container_id'    => '',
             'menu_class'      => 'nav nav-pills',
             'menu_id'         => 'menu-{menu slug}',
             'echo'            => true,
             'fallback_cb'     => 'wp_page_menu',
             'before'          => '',
             'after'           => '',
             'link_before'     => '',
             'link_after'      => '',
             'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
             'depth'           => 0,
             'walker'          => ''
           )
         );
       ?>
       </nav>
       ```
   
 * an it renders me
 *     ```
       <nav class="col-md-9" role="navigation">
         <div class="nav nav-pills">
           <ul>
             <li class="page_item page-item-1791 current_page_item"><a href="http://retesz.w.pw/biografia/">Biográfia</a></li>
             <li class="page_item page-item-1783"><a href="http://retesz.w.pw/">Főoldal</a></li>
           </ul>
         </div>
       </nav>
       ```
   
 * From what I understand in the codex:
 * > $menu_class
   >  (string) (optional) The class that is applied to the ul element
   > which encloses the menu items. Multiple classes can be separated with spaces.
   > Formerly known as $wrap_class. Default: menu
 * It’s supposed to apply the class `nav nav-pills` to the ul, not the container
   div, especially because I turned off the container with `'container' => false`.
 * Can someone explain what I’m doing wrong.
 * Any help is appreciated.

Viewing 1 replies (of 1 total)

 *  Thread Starter [reddo](https://wordpress.org/support/users/reddo/)
 * (@reddo)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/wp_nav_menu-not-rendering-menu_class-correctly/#post-4303736)
 * Any ideas how I can add a class to the ul of the menu?

Viewing 1 replies (of 1 total)

The topic ‘wp_nav_menu not rendering menu_class correctly’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [reddo](https://wordpress.org/support/users/reddo/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/wp_nav_menu-not-rendering-menu_class-correctly/#post-4303736)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
