Site logo

[Resolved] Remove all JavaScript and Mobile menu?

Home Forums Support [Resolved] Remove all JavaScript and Mobile menu?

Home Forums Support Remove all JavaScript and Mobile menu?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2227448
    Kev

    Hey there,

    I’m working on a re-design of my site, and I’m going with a brutal design. Do achieve that, I don’t want any kind of hamburger menu on mobile devices. I can’t seem to find a way of disabling the hamburger menu in the customiser though. Is this even possible from customiser, or would I need to add some custom CSS that removes the @media queries?

    I’d also like to remove all javascript. It’s not needed anywhere on my site (once the mobile menu is gone) so loading Jquery and other JS is just a waste. How do I do that?

    Thanks folks!

    #2227585
    David
    Staff
    Customer Support

    Hi there,

    1. ensure you do NOT have the Mobile Header enabled in Customizer > Layout > Header.
    2. set the Mobile Menu Breakpoint to 0 in Customizer > Layout > Primary Navigation.
    3. Dequeue any menu related scripts ( NOTE: this includes Drop downs ) with this PHP Snippet:

    add_action( 'wp_enqueue_scripts', 'tu_remove_menu_scripts', 50 );
    function tu_remove_menu_scripts() {
        wp_dequeue_script( 'generate-menu' );
        wp_dequeue_script( 'generate-dropdown' );
    }

    GP only loads the scripts it needs. And the only jQuery dependency is the Sticky Navigation.

    #2227955
    Kev

    That worked. Thanks David.

    #2228245
    David
    Staff
    Customer Support

    Glad to be of help

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.