我的模板中有这段代码:
<?php wp_nav_menu( array( 'container' => '' ) ); ?>
它输出菜单但包装在<div class="menu">
据我了解文档页面它不应该输出 .
好,我知道了。您需要设置:menu' => 'Name of the menu'
以及'theme_location'=> 'main_menu'
...类似:
<?php wp_nav_menu(array('sort_column' => 'menu_order', 'menu' => 'Name of the menu',
'container_class' => 'main-menu2', 'container_id' => 'menu-l', 'theme_location' => 'main-
menu') ); ?>
也许有人也可以使用它:)