• 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 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)
  • 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.

    This worked great! Thanks!

    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

    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.