Title: Problem with wp_nav_menu
Last modified: August 19, 2016

---

# Problem with wp_nav_menu

 *  [chomiczek](https://wordpress.org/support/users/chomiczek/)
 * (@chomiczek)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/problem-with-wp_nav_menu/)
 * I have problem with dynamic menu, when I try use `<?php wp_nav_menu(); ?>` in
   browser I see: `<div class="menu"><ul><li class="page_item page-item-8"><a href
   ="?page_id=8" title="Home">Home</a></li><li class="page_item page-item-5 current_page_item"
   ><a href="?page_id=5" title="O Nas">O Nas</a></li></ul></div>`
 * When I check in [codex](http://codex.wordpress.org/Function_Reference/wp_nav_menu)
   i see that I must use:
    `<?php wp_nav_menu( array( 'container' => '' ) ); ?>`
   but I have problem with this, because I still have <div> </div>
 * When I try `'menu_class' => 'moja_nazwa'` myname should add a class to UL, and
   here it is added to <div>, while `'menu_id' => 'aa'` is supposed to add the ID
   to the UL, and here does not add at all?
 * I edit nav-menu-template.php, where I delete all info about contener, and in 
   browser I still have <div> </div>
 * I must have this: `<?php wp_nav_menu( array( 'container' => 'false', 'menu_class'
   => 'moja_klasa', 'menu_id' => 'menu', ) ); ?>`
    in browser: `<ul class="moja_klasa"
   id="menu"><li>sdfs</li><li>ss</li></ul>`
 * Pls help

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

 *  [Kapil Chugh](https://wordpress.org/support/users/kapilchugh/)
 * (@kapilchugh)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/problem-with-wp_nav_menu/#post-1617350)
 * It seems either that you haven’t created any menu in backend or you didn’t select
   any primary navigation.Because if no menu was found or no item exists in menu
   then by default it calls default callback function (i.e wp_page_menu )
    Once 
   i also removed container div and added some classes in
    -  and it worked perfectly fine for me.
 *  [ying.qn](https://wordpress.org/support/users/yingqn/)
 * (@yingqn)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/problem-with-wp_nav_menu/#post-1617571)
 * This worked great! Thanks!
 *  [webgurus](https://wordpress.org/support/users/webgurus/)
 * (@webgurus)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/problem-with-wp_nav_menu/#post-1617625)
 * all who are facing same problem as ‘chomiczek’ just make sure that you are using‘
   menu’ element in passing array as parameter in ‘wp_nav_menu’ function call.
 * [@chomiczek](https://wordpress.org/support/users/chomiczek/)
 * in your case you should have below array parameters
 * <?php wp_nav_menu( array(‘menu’=>’MENU_NAME_HERE’ ,’container’ => ‘false’, ‘menu_class’
   => ‘moja_klasa’, ‘menu_id’ => ‘menu’, ) ); ?>
 * notice
    ‘menu’=>’MENU_NAME_HERE’
 * hope this will help you

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

The topic ‘Problem with wp_nav_menu’ is closed to new replies.

## Tags

 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [problem](https://wordpress.org/support/topic-tag/problem/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 4 participants
 * Last reply from: [webgurus](https://wordpress.org/support/users/webgurus/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/problem-with-wp_nav_menu/#post-1617625)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
