Hey all I am working with the navigation bar in Wordpress 3.0 and have to get rid of the 'menu_id'=> '' section of this code. <?php wp_nav_menu( array('menu' => 'Main', 'container' => '' , 'menu_class' => '', 'menu_id'=> '' )); ?> As you can see I have it set to nothing but its still coming up in the code. Does anyone know how I can override this so I can get this the nav 3.0 to work? Thanks
According the Codex, you can delete menu_id because it's optional. <?php wp_nav_menu( array('menu' => 'Main', 'container' => '', 'menu_class' => '')); ?> Code (markup):
Ya but when I do that it automatically put it in, if you did that it would show up if you view the source
Do you mean <ul id='menu-menu'> ? I think that is the default menu list. It appears whenever there is a custom menu, even if it has no menu items. I had to delete the menu name to get rid of it. However, wp_nav_menu defaults to wp_page_menu when there is no custom menu, unless you specify no callback function with 'fallback_cb' => '' <?php wp_nav_menu( array('menu' => 'Main', 'container' => '', 'menu_class' => '', 'fallback_cb' => '')); ?> Code (markup):
I used your code Cash Nebula and it still isnt working this code <ul id="menu-main"> is still somehow is sneaking into the coding. THis is what I need to get rid of because it is preventing the menu from showing up
So much for being optional! The ID always appears if a menu is selected and there is no class name. To get rid of the ID, either use a class name or select no menu in the "Primary Navigation" dropdown. I will try a few other things to see if I can make it go away.
That is stupid of WP! The menu_id is preventing my navigation bar from working! There has to be a way to override or void it. Thanks for the help. When I use a class name the menu_id still pops up Where is the Primary Navigation dropdown?