I just realized the fallback doesn’t work for my project when a custom menu doesn’t exist. I can’t figure out what I am missing. Here is the code that displays the nav menu:
$menu = wp_nav_menu(
array(
'menu_class' => 'reset sf-menu',
'container_id'=>'nav',
'echo'=>0
)
);
$menu = str_replace("n", "", $menu);
$menu = str_replace("r", "", $menu);
$menu = str_replace("t", "", $menu);
echo $menu;
here is the test site: http://brainbuzzmedia.com/themes/amplify/styles/charcoal/
You’ve not added a
fallback_cb
key to the argument array. You also need to add atheme_location
key:Alternately, you could wrap your code in an
if ( has_nav_menu( 'location_name' ) )
conditional: