我的模板中有以下代码:
<?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') ); ?>
也许有人也可以使用它:)