Wordpress 在子主题中注册附加菜单
我试图在child theme function.php中注册额外的菜单位置,如下所示。但菜单位置未显示在管理面板中。我做错了什么Wordpress 在子主题中注册附加菜单,wordpress,menu,themes,registering,Wordpress,Menu,Themes,Registering,我试图在child theme function.php中注册额外的菜单位置,如下所示。但菜单位置未显示在管理面板中。我做错了什么 function hb_register_slider_menu() { register_nav_menu('slider-section-menu', __('slider-section-menu', 'hbthemes')); } add_action('init', 'hb_register_slider_menu'); 你试过用这种方法吗
function hb_register_slider_menu() {
register_nav_menu('slider-section-menu', __('slider-section-menu', 'hbthemes'));
}
add_action('init', 'hb_register_slider_menu');
你试过用这种方法吗
<?php
add_action( 'after_setup_theme', 'slider_section_menu' );
function slider_section_menu() {
register_nav_menu( 'slider-section-menu', __( 'Slider Menu', 'theme-slug' ) );
}
?>
参考: