• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Superfish deactivation snippet not working.

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Superfish deactivation snippet not working.

This topic is: resolved

Tagged: Disable Superfish

  • This topic has 10 replies, 4 voices, and was last updated 9 years, 2 months ago by studionoobly.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • May 3, 2016 at 4:24 am #184878
    studionoobly
    Member

    Hi,

    I'm using (from what I can tell) the well tested and well used snippet below to prevent the superfish scripts from loading on to a website that I'm building (locally) but it doesn't seem to work? I've tried clearing my cache reloading a bunch of times but they still turn up every time. Is anyone else having this issue, does anyone know of sure fire way get rid of these scripts?

    add_action( 'custom_disable_superfish', 'mb_unregister_superfish' );
    function mb_unregister_superfish() {
    wp_deregister_script( 'superfish' );
    wp_deregister_script( 'superfish-args' );
    }

    Thanks

    http://local
    May 3, 2016 at 4:41 am #184879
    Brad Dalton
    Participant

    Where did you put the code?

    Here's the SP code which always works https://gist.github.com/studiopress/5570624


    Tutorials for StudioPress Themes.

    May 3, 2016 at 4:50 am #184880
    studionoobly
    Member

    Thanks Brad

    But it still seems to be getting it from "wp-content/themes/genesis/lib/js/menu/superfish.min.js" I have the code at the bottom of my functions.php, I have tested in a different browser in private mode and they still turn up?

    May 3, 2016 at 5:27 am #184887
    Victor Font
    Moderator

    The action you are supposed to be using is wp_enqueue_scripts not custom_disable_superfish. There is no WordPress action for custom_disable_superfish. This is the correct code:

    add_action( 'wp_enqueue_scripts', 'sp_disable_superfish' );
    function sp_disable_superfish() {
    	wp_deregister_script( 'superfish' );
    	wp_deregister_script( 'superfish-args' );
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 3, 2016 at 5:35 am #184889
    studionoobly
    Member

    Thanks Victor, but that is the same code as Brad linked too.

    May 3, 2016 at 7:35 am #184898
    Victor Font
    Moderator

    That is the correct code. Your code is trying to add an action that doesn't exist.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 3, 2016 at 8:11 am #184901
    studionoobly
    Member

    Yes, I know it's the correct code, what I'm saying is that I replaced the old code with the one you and Brad provided and that did not work either.
    Thanks

    May 12, 2016 at 5:00 pm #185499
    joellereeder
    Member

    I'm actually experiencing this same issue. I'm using the exact snippet posted here by Victor, which is the same one found in the Genesis Snippets. No matter where I place it in the functions file, it does not disable Superfish.

    I am using Genesis 2.27, I've got a Genesis sample child theme going with very minimal customizations thus far and I've even tried turning off all of the plugins to see if that resolved the conflict.

    But no, that snippet does not disable superfish. Any ideas?

    Thanks! 🙂

    May 13, 2016 at 2:32 am #185546
    studionoobly
    Member

    I'm afraid not, I think I have tried all the same things you have but they still don't go? The only thing I can think but haven't tried is going through all the code I have added to my custom theme functions file and temporarily block out each one, then reload the browser after each try and see if it's something else that is blocking that bit of code. Given the amount of code I have in that file it could take a while. If I find anything I'll let you know.

    May 13, 2016 at 3:57 am #185552
    Victor Font
    Moderator

    Do you have accessibility support activated for drop down menus? If so, you won't be able to deactivate superfish until you remove accessibility support for drop down menus. This is the function that checks for superfish support:

    function genesis_superfish_enabled() {
    	return ( ! genesis_html5() && genesis_get_option( 'superfish' ) ) || genesis_a11y( 'drop-down-menu' ) || apply_filters( 'genesis_superfish_enabled', false );
    }

    That function returns true if drop down menu support for accessibility is active. Look in functions.php for accessibility support:

    //* Add accessibility support
    add_theme_support( 'genesis-accessibility', array( '404-page', 'drop-down-menu', 'headings', 'rems', 'search-form', 'skip-links' ) );

    Remove 'drop-down-menu',
    Add apply_filters( 'genesis_superfish_enabled', false ); to the file and superfish is deactivated. I just tested this on Digital Pro in my local environment.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 13, 2016 at 4:59 am #185559
    studionoobly
    Member

    Yus!

    Thanks Victor, that did the trick. Average load time on my pages now (on an regular 2G network) is down to about 2 seconds.

    Thanks,

    Noah

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble