Edit, complete function –
function themename_setup() {
// WordPress Menu Locations
register_nav_menus(array(
'primary' => esc_html__( 'Primary', 'themename' ),
'footer ' => esc_html__( 'Footer', 'themename' ),
));
}
add_action( 'after_setup_theme', themename_setup' );
The primary menu works exactly as expected
I’ve set up a foot menu location in my functions.php
file;
register_nav_menus(array(
'primary' => esc_html__( 'Primary', 'themename' ),
'footer ' => esc_html__( 'Footer', 'themename' ),
));
In the admin, I’ve created a new menu and assigned it to this new location.
However, when I output this menu the menu items retrieved are all of the pages from the admin.
<?php wp_nav_menu(array('theme_location' => 'footer')); ?>
I only want the pages that have been assigned to this menu