我不认为你需要再次启动菜单register_nav_menus()
它本身就是一个发起人。
Syntax: <?php register_nav_menu( \'your-menu-handle\', \'Your Menu Label\' ); ?>
复制以下代码并将其粘贴到functions.php
without 任何功能或add_action()
, 我希望它能起作用:
register_nav_menus(
array(
\'front_login_menu\' => __( \'Front Login Menu location\'),
\'top_front_general_menu\' => __( \'Top Front General Menu\'),
\'top_general_menu\' => __( \'Top General Menu\'),
\'top_student_menu\' => __( \'Top Student Menu\'),
\'top_admin_menu\' => __( \'Top Admin Menu\'),
\'top_trainer_menu\' => __( \'Top Trainer Menu\' )
)
);
在要显示菜单的主题中使用以下代码:
<?php wp_nav_menu (
array (
\'theme_location\'=>\'front_login_menu\', //change the slug here where necessary
\'fallback_cb\'=>\'\'
)
); ?>