[英]I cannot see the menu that I create in my theme, in wordpress admin
我在我的 wordpress 主题中注册了我的主菜单,但是当我保存并尝试在我的管理面板中查看时,没有出现。
编码:
function games_register_my_menus(){
register_nav_menus(
array(
'main-menu' => __( 'Header Menu' )
)
);
}
add_action( 'init', 'games_register_my_menus' );
你的行动为时过早。 您需要等到菜单设置完毕。
改变
add_action( 'init', 'games_register_my_menus' );
至
add_action( 'after_setup_theme', 'games_register_my_menus' );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.