当我尝试在Wordpress中显示其中一个辅助菜单时,它将再次显示主菜单('主菜单'),而不是'footer-menu'
或{{1 }}。我使用以下代码显示我的菜单:
'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
非常感谢任何帮助。
答案 0 :(得分:0)
从codex,register_nav_menus
用法
<?php register_nav_menus( $locations ); ?>
参数
$locations
(array) (required) An associative array of menu location slugs (key) and descriptions (according value).
Default: None
有关详细信息,请参阅codex codex
答案 1 :(得分:0)
您的代码theme-location
中有一个拼写错误theme_location
试试wp_nav_menu(array('theme_location' => 'info-menu'));
它会起作用