wp_nav_menu cant get rid of container, wrong IDs
-
This was working before on WordPress, but now Im using multisite but I can’t seem to change the container or class/id values in the menu. The correct theme accepts all my other changes.
<nav> <?php wp_nav_menu( array('theme_location' => 'main_menu', 'sort_column' => 'menu_order', 'container'=>'', 'menu_class' => 'myclass', 'menu_id' => 'myid') ); ?> </nav>
Even though
'container'=>''
it still prints a div and prints a div no matter what I put. The menu_class isn’t applied to the UL but the DIV that comes from nowhere. Also the menu_id isn’t applied.<nav> <div class="myclass"><ul><li class="page_item page-item-2"><a href="https://www.DOMAIN.com/about/" title="About">About</a></li></ul></div> </nav>
EDIT: Ok I forgot to create a custom menu and apply it to the registered menu location when rebuilding site as MU. I get this working now.
<ul id="myid" class="myclass"><li id="menu-item-22" class="menu-item menu-item-type-post_type menu-item-22">.....
- The topic ‘wp_nav_menu cant get rid of container, wrong IDs’ is closed to new replies.