Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Remove parent theme menu in child theme Wordpress

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 240
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: