1

I am creating some menus but when I go to the menu dashboard It shows up as "Nice Name" and the 'Menu Name' does anyone know how to prevent this or remove it? I attached photo to illustrate what I mean:

enter image description here

I add my menu in my function.php like so:

add_action('init', 'register_menus');
function register_menus(){
    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( 
        array(
            'primary-nav', __( 'Primary Menu'),
            'footer-nav', __( 'Footer Menu')
        ) 
    );
}

The I call it in my header file like so:

 if(has_nav_menu('primary-nav')){ 
        wp_nav_menu(
            array(
                'theme_location' => 'primary-nav',
                'container' => 'nav',

            )
        ); 
    } 

This has me stumped right now.

2

You register an array of four menus. If you reformat your code, you will see it.

[…]
array(
    'primary-nav', 
    __( 'Primary Menu'),
    'footer-nav', 
    __( 'Footer Menu')
); 
[…]

Adapt your code to an array with custom keys and you will be fine:

[…]
array(
    'primary-nav' => __( 'Primary Menu'),
    'footer-nav' => __( 'Footer Menu')
); 
[…]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.