• 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

Genesis jQuery not working in child theme, broken after 2.2.7 ugrade.

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 › Genesis jQuery not working in child theme, broken after 2.2.7 ugrade.

This topic is: not resolved

Tagged: broken, child, child theme, jquery, not defined, not working, referenceerror, theme, uncaught, undefined, upgrade

  • This topic has 1 reply, 2 voices, and was last updated 7 years ago by Victor Font.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 23, 2016 at 9:17 pm #182146
    B1gJ4k3
    Member

    I'm going to file this under things that don't make any sense...

    I recently updated my Genesis theme to 2.2.7 and found all the jQuery broken in my child theme. Getting the error

    Uncaught ReferenceError: jQuery is not defined

    Looking in the source code, I see that jQuery was no longer being included on the page. WTF??? After beating my head up against the wall for several hours, I decided to work from a blank Genesis child theme downloaded from the Studiopress website. And noticed these two lines need to be included for jQuery to be included:

    add_theme_support( 'html5' );
    add_theme_support( 'genesis-accessibility', array( 'headings', 'drop-down-menu',  'search-form', 'skip-links', 'rems' ) );

    or, at the bare minimum:

    add_theme_support( 'html5' );
    add_theme_support( 'genesis-accessibility', array( 'drop-down-menu') );

    What could possibly be the reason for this? Removing built-in WordPress funtionality and then adding it back in? Is there really much performance gained from removing jQuery, especially if it's undocumented and breaks existing child themes????

    (This could have been an issue in previous 2.2 releases. I just updated to 2.2.7 today)

    Posting this in case somebody else has the same problem. Hopefully it will save you a few hours of head-banging....

    March 24, 2016 at 5:03 am #182161
    Victor Font
    Moderator

    If the Genesis 2.2.7 update broke jQuery than there would be hundreds of posts both on this forum and on the Genesis WP Facebook page. Version 2.2.7 has been out for a couple of weeks and yours seems to be a single isolated instance. I've updated dozens of sites to 2.2.7 without any issues. jQuery works on all of them after the update.

    For convenience, WordPress registers many popular scripts used by developers, but it does not load them on the front end, jQuery included. It's up to the theme developer to load theme. See https://developer.wordpress.org/reference/functions/wp_enqueue_script/ for more information.

    Genesis does not load jQuery either, except as you discovered, when jQuery is a dependency of a Genesis supplied script. In which case, jQuery is loaded by the WordPress wp_enqueue_script function because it was pre-registered by WordPress. The only scripts loaded by Genesis that require jQuery as a dependency are the drop down menu and superfish scripts. If you are not using dropdown menus and/or superfish, then it's up to you to load jQuery in the child theme.

    Genesis 2.2.7 did not break jQuery. There's something else going on with your site.


    Regards,

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

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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