Complete the code to register a navigation menu in WordPress.
register_nav_menus(array('[1]' => __('Primary Menu')));
The 'primary' key is commonly used to register the main navigation menu in WordPress themes.
Complete the code to display the registered navigation menu in a theme.
wp_nav_menu(array('theme_location' => '[1]'));
To display the main navigation menu, use the 'primary' theme location.
Fix the error in the code to correctly register a menu location.
register_nav_menus([1]);The value should be wrapped in the translation function __() for localization, and the array must be created with array() in PHP 7+ for compatibility.
Fill both blanks to create a menu with a custom CSS class and fallback.
wp_nav_menu(array('theme_location' => '[1]', 'menu_class' => '[2]'));
'primary' is the theme location, and 'main-menu' is a common CSS class for styling the menu.
Fill all three blanks to create a menu with a container, container class, and depth limit.
wp_nav_menu(array('theme_location' => '[1]', 'container' => '[2]', 'depth' => [3]));
'primary' is the menu location, 'div' is the container element wrapping the menu, and '2' limits the menu depth to two levels.