I’ve got a nav function in functions.php:
function html5blank_nav()
{
wp_nav_menu(
array(
'theme_location' => 'header-menu',
'menu' => '',
'container' => false,
'menu_class' => 'nav',
'menu_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul class="%2$s">%3$s</ul>',
'depth' => 0,
'walker' => ''
)
);
}
And it’s called in header.php with:
<?php html5blank_nav(); ?>
And my output is:
<div class="nav">
<ul>
<li class="page_item page-item-2"><a href="http://localhost/?page_id=2">Sample Page</a></li>
<li class="page_item page-item-4"><a href="http://localhost/?page_id=4">Test page</a></li>
</ul>
</div>
But What I was trying to achieve was this structure:
<ul class="nav">
<li><a href="http://localhost/?page_id=2">Sample Page</a></li>
<li><a href="http://localhost/?page_id=4">Test page</a></li>
</ul>
I thought that setting container=false would get rid of the containing divs, and that setting menu_class=’nav’ would add the nav class to the ul as it states here: http://codex.wordpress.org/Function_Reference/wp_nav_menu
Why isn’t it recognising my settings?
from the Codex:
In order to remove navigation container, theme location specified in functions.php and used among arguments in function wp_nav_menu ( eg. ‘theme_location’ => ‘primary-menu’ ) must have a menu assigned to it in administration! Otherwise argument ‘container’ => ‘false’ is ignored