Genesis Deactivate Superfish Menu, public domain image from pixabay.com

Genesis Deactivate Superfish Menu Support

Genesis Deactivate Superfish Menu, public domain image from pixabay.com

The Genesis Framework includes the popular jQuery Superfish Dropdown Menu Plugin. For most themes, the superfish extension is activated by default. Ever since the inclusion of superfish in Genesis, the method for deactivating it was as simple as including the following code snippet in your child theme’s functions.php file:

https://gist.github.com/vfontjr/4d7e83d23b4d6ac8b32b48bf6068e962#file-sp_disable_superfish-php

Since the release of Genesis 2.2 however, the above snippet no longer works. This is because of the new accessibility features built into the Genesis Framework. The superfish extension is required if you enable drop-down-menu support for accessibility. Among other things, superfish provides the following functionality:

  • Support for touch devices
  • Timed delay on mouseout
  • Animations
  • Keyboard accessibility
  • Supports the hoverIntent plugin
  • Indicates the presence of submenus by adding CSS-based arrows to relevant anchors
  • Can show the path to your current page

With the support superfish provides, if you want a WCAG 2.0 compliant website, you need to leave the extension activated.

Deactivating Superfish

The Genesis function that tests for superfish support is genesis_superfish_enabled(). The source code is:

https://gist.github.com/vfontjr/4d7e83d23b4d6ac8b32b48bf6068e962#file-genesis_superfish_enabled-php

See the section in the return statement that reads genesis_a11y( ‘drop-down-menu’ ). This is the test for accessibility drop-down-menu support. So if you are using the Genesis accessibility features, you now have to turn off support for dropdown menus if you want to deactivate superfish. Look for a line similar to the following in your child theme’s functions.php file:

https://gist.github.com/vfontjr/4d7e83d23b4d6ac8b32b48bf6068e962#file-genesis-accessibility-php

Delete ‘drop-down-menu’, from the above line and add the following to functions.php:

https://gist.github.com/vfontjr/4d7e83d23b4d6ac8b32b48bf6068e962#file-genesis_superfish_enabled_filter-php