Hello Everyone, I am here to teach you how to remove parent theme menu in child theme wordpress.
The below code is in your parent theme for register the menu.
add_action( 'after_setup_theme', 'register_themename_menu' );
function register_themename_menu() {
register_nav_menu( 'primary', __( 'Primary Navigation ) );
}
If you want to remove the parent theme menu using unregister_nav_menu() function. This function takes one parameter, the menu location identifier slug used in the register_nav_menu() function.
For this you just copied below code and paste into child theme functions.php file
function remove_parent_theme_features() {
unregister_nav_menu( 'primary' );
}
I hope it help you. Thank-you readers!
0 Comment(s)