I'm trying to use wp_nav_menu to only display a menu if one exists, otherwise, display nothing.
If I delete the menu, it will output a list of the pages.
Here are a couple of things I've unsuccessfully tried:
<?php
function wp_get_nav_menu_object( $menu ) {
if ( ! $menu )
wp_nav_menu( array( 'menu_class' => 'nav', 'container' => '' ) );
}
?>
I've also tried:
function wp_get_nav_menu_object( $menu ) {
if ( ! $menu )
return false;
if ( $menu )
return wp_nav_menu( array( 'menu_class' => 'nav', 'container' => '' ) );
}
How can I use wp_nav_menu to only display a menu if one exists, otherwise show nothing?