Skip to main content
Code cleanup
Source Link
chrisguitarguy
  • 21.5k
  • 5
  • 62
  • 99

You can just specify false as the fallback_cb argument of wp_nav_menu. Nothing will show up -- rather, wp_nav_menu will return false (echoing nothing out).

<?php
wp_nav_menu(
    array( 
        'theme_location' => $main_nav, 
        'menu_class'     => 'nav', 
        'container'      => '',
        'fallback_cb'    => false
    )
 );

You can just specify false as the fallback_cb argument of wp_nav_menu. Nothing will show up -- rather, wp_nav_menu will return false (echoing nothing out).

<?php
wp_nav_menu(
    array( 
        'theme_location' => $main_nav, 
        'menu_class'     => 'nav', 
        'container'      => '',
        'fallback_cb'    => false
    )
 );

You can just specify false as the fallback_cb argument of wp_nav_menu. Nothing will show up -- rather, wp_nav_menu will return false (echoing nothing out).

<?php
wp_nav_menu(array( 
    'theme_location' => $main_nav, 
    'menu_class'     => 'nav', 
    'container'      => '',
    'fallback_cb'    => false
));
Source Link
chrisguitarguy
  • 21.5k
  • 5
  • 62
  • 99

You can just specify false as the fallback_cb argument of wp_nav_menu. Nothing will show up -- rather, wp_nav_menu will return false (echoing nothing out).

<?php
wp_nav_menu(
    array( 
        'theme_location' => $main_nav, 
        'menu_class'     => 'nav', 
        'container'      => '',
        'fallback_cb'    => false
    )
);