You don’t add the line so much as modify the fallback_cb parameter wherever the wp_nav_menu() function is called in your theme.
It’s specific to your theme so I can’t tell you where it exists though the main menu is commonly in the header.php file.
Alternatively, it has just occurred to me that we can filter all the nav menu args.
Untested (so please test before using in production) but the following snippet should turn off fallback menus for *all* menus on you site. You would need to add it to your theme’s functions.php file or add it to via the Code Snippets plugin.
/**
* Disables the fallback page menu for all menus
*
* @param array $args Array of wp_nav_menu() arguments.
* @return array
*/
function kia_nav_menu_args( $args ) {
$args['fallback_cb'] = '';
return $args;
}
add_filter( 'wp_nav_menu_args', 'kia_nav_menu_args' );
Hope it helps!
It worked perfectly, thanks!!
Very easy to implement.
Glad to hear it. Yes, I think this is an easier method.. I’ll try to update the FAQ eventually.