• 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

Classes being removed: sf-js-enabled sf-arrows

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 › Design Tips and Tricks › Classes being removed: sf-js-enabled sf-arrows

This topic is: not resolved

Tagged: Superfish

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 11 months ago by simbasounds.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • January 4, 2015 at 8:55 am #136011
    simbasounds
    Member

    I'm trying to manually add a menu to header-right in functions.php.
    This menu needs to have certain classes which is why I'm not using the widget area.

    I also need the drop-downs to be fancy, but two of my manually-added classes - sf-js-enabled sf-arrows - are being removed by JavaScript, presumably by the SuperFish script itself. When I disable JavaScript the classes are not removed.

    Demo of the error.

    In addition I get console errors: superfish.min.js?ver=1.7.4:1 Uncaught TypeError: Cannot read property 'sfTimer' of undefined. Perhaps this is related to the Genesis /themes/genesis/lib/js/menu/superfish.min.map 404 (Not Found) bug?

    Is there any way around the classes being removed?

    My code in functions.php:

    add_action( 'genesis_header_right', 'header_nav_menu' );
    function header_nav_menu(){
    	wp_nav_menu( array('menu' => 'Main menu',
    						'container' => 'nav',
    						'container_class' => 'cbp-spmenu cbp-spmenu-horizontal cbp-spmenu-top',
    						'container_id' => 'cbp-spmenu-s3',
    						'menu_class' => 'xyz js-superfish sf-js-enabled sf-arrows genesis-nav-menu menu'
    					)
    				);
    }
    http://simonbarnett.co.za/tests/
    January 4, 2015 at 10:28 am #136026
    Lorraine
    Participant

    You should be able to use the normal custom menu widget which will then be assigned a class according to the widget. This is some code from a live site:

    <section id="nav_menu-2" class="widget widget_nav_menu"><div class="widget-wrap"><nav class="nav-header" role="navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"><ul id="menu-main-menu" class="menu genesis-nav-menu"><li id="menu-item-104" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-104">LINKS HERE...

    I think with what's above you could possibly achieve what you are trying to do below as the menu is assigned it's own ID.

    'container' => 'nav',
    						'container_class' => 'cbp-spmenu cbp-spmenu-horizontal cbp-spmenu-top',
    						'container_id' => 'cbp-spmenu-s3',
    						'menu_class' => 'xyz js-superfish sf-js-enabled sf-arrows genesis-nav-menu menu'

    I sometimes work with graphic designers who give some corking navigation layouts and I haven't been beaten yet unless it ubermenu style. http://www.gmhcashregisters.co.uk/ This has some different styles here...

    January 4, 2015 at 11:06 am #136031
    simbasounds
    Member

    Thanks Lorraine, I did manage to work around it, yes, by modifying the jQuery to target the widget ids.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ 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

© 2023 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