Wordpress显示错误的自定义菜单

Wordpress显示错误的自定义菜单,wordpress,menu,Wordpress,Menu,当我试图在Wordpress中显示我的任何一个辅助菜单时,它将再次显示主菜单(“主菜单”),而不是'footer-menu'或'info-menu'。我使用以下代码显示我的菜单: wp_nav_menu( array( 'theme-location' => 'info-menu', 'depth' => 1, 'conta

当我试图在Wordpress中显示我的任何一个辅助菜单时,它将再次显示主菜单(“主菜单”),而不是
'footer-menu'
'info-menu'
。我使用以下代码显示我的菜单:

                wp_nav_menu( array(
                    'theme-location' => 'info-menu',
                    'depth'      => 1,
                    'container'  => false,
                    'menu_class' => 'nav-info',
                    'fallback_cb' => 'wp_page_menu')
                );
我在
function.php
中注册了我的菜单:

function register_my_menu() {

    register_nav_menus(
        array(
            'main-menu' => __( 'Main Menu', 'ibasketball' ),
            'footer-menu' => __( 'Footer Menu', 'ibasketball' ),
            'info-menu' => __( 'Info Menu', 'ibasketball' )
        )
    );
}
add_action( 'init', 'register_my_menu' );

非常感谢您的帮助。

来自codex,在
注册导航菜单中只有一个参数可用。

用法


有关更多详细信息,请参阅codex

您的代码中有输入错误
主题位置
应为
主题位置
尝试
wp\u导航菜单(数组('theme\u location'=>'info menu')它会工作的

 <?php register_nav_menus( $locations ); ?> 
$locations

(array) (required) An associative array of menu location slugs (key) and descriptions (according value).
Default: None