Disable mobile menu search

Home Forums Reykjavik Disable mobile menu search

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #21603

    rmoses123
    Participant

    Disable mobile menu search

    Resolved

    Hey there! Have you noticed this support service is provided FREE of charge?
    If you like the speed and accuracy of resolutions, please consider supporting me with a small donation. Thank you

    Consider a donation →

    Hello,

    I have been trying to disable the mobile menu somehow, I am using a child theme.
    If I take the class-menu.php file and put it on my child theme it doesn’t override it, I tried to remove it on the parent theme in that file and it worked, but this is not a solution as it will be rewritten when there’s an update.

    Is there a way to hook into it with functions.php somehow and disable the mobile search?

    I know I can hide it with CSS, but since search is disabled on the site I am trying to remove anything that has to do with it and keep my output code as minimal as possible.

    Thanks in advance.

    #21604

    Oliver Juhas
    Keymaster

    Hi rmoses123,

    Indeed, the easiest solution would be to hide it with CSS.

    But if you would like to remove the complete search form HTML, please use this code in your child theme‘s functions.php file:

    function child_theme_setup() {
    	remove_filter( 'wp_nav_menu', 'Reykjavik_Menu::mobile_menu_search', 20, 2 );
    }
    add_action( 'after_setup_theme', 'child_theme_setup', 100 );

    If I take the class-menu.php file and put it on my child theme it doesn’t override it

    Please note that my themes are built in more flexible way. They are using filter and action hooks, so you can override and rearrange anything in the theme with (almost) no actual child theme full file overrides.

    Best regards,

    Oliver Juhas
    WebMan Design

    #21605

    rmoses123
    Participant

    So simple yet powerful :)

    Thanks a lot for the quick reply and the help, works great!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.