• 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

Move jQuery to Google CDN – Minimum Pro

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 › Move jQuery to Google CDN – Minimum Pro

This topic is: not resolved

Tagged: minimum pro jQuery

  • This topic has 3 replies, 3 voices, and was last updated 9 years, 11 months ago by frobn.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 31, 2015 at 6:22 am #161039
    Mark-C
    Member

    Hi All,

    Theme: Minimum Pro
    jQuery: version 1.11.2

    I need to move jQuery to Google CDN

    I have inserted the following code into my functions.php

    // load jquery from google cdn in wordpress
    function enqueue_jquery_google_cdn() {
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js', false, NULL, true );
    wp_enqueue_script( 'jquery' );
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_jquery_google_cdn' );

    Problem
    When i launch my page the backstretch image simply disappears.

    I see references in front-page.php to backstretch, but unsure how to configure.

    Your help would be much appreciated.

    http://localhost
    August 3, 2015 at 5:22 pm #161334
    Victor Font
    Moderator

    First, at the top of the page you say you need jQuery 1.11.2, which is the same version pre-loaded in WordPress. You are loading version 1.11.1, which is an earlier version.

    Second, you need to make certain you are loading jQuery before any dependencies.

    Third, why are you loading jQuery from Google? It's not going to provide you with any advantage over your local version and actually give you poorer performance scores because you won't have header expiration details because it's not coming from your server. That's why I download Google fonts whenever I can and deliver them from the local servers.


    Regards,

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

    August 3, 2015 at 11:58 pm #161363
    Mark-C
    Member

    Hi Victor,

    Thank you for you reply.

    My mistake, I meant to say V1.11.2 in the script.
    I am simply code writing/testing in the local environment in readiness to roll out in live.

    The basic principle of a web page loading is the following logical order:

    HTML
    CSS
    JAVA

    In short, when CSS or Java is called upon you need to load them completely before you are able to render additional HTML. This waiting around will cause pagespeed issues that Google frown upon as well as poor user experience. Calling jQuery from Google built in libraries/servers will provide significant pagespeed advantages. However, we need to defer Java and CSS from loading on the page before HTML. Additionally, we need to be able to render all instances above the fold. Therefore, careful planning of site design and structure is key.

    You mention that you load locally Google fonts from your server. Unless your servers out perform Google, have untold resources at there disposal around the world, fault tolerance incase of latency and so forth, you are simply making a call to a basic run of the mill server to deliver a font set to a users browser. Remember, based upon your sites cache configuration and a users previous web browsing experience, there is a high probability that certain objects have already been cached on the user machine. It makes no sense to simply make many calls for the same objects. Again, this is basic 101 on jQuery library scripts.

    I understand that jQuery V1.11.2 must be present before any dependencies, i.e. resposonsive menu, backstretch, etc.

    My original questiion is. how do I pull jQuery 1.11.2 from Google CDN?

    Thank You

    August 8, 2015 at 7:00 am #161783
    frobn
    Member

    Try it this way in your function.

    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js' );
    wp_enqueue_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', array( 'jquery' ) , false, NULL, true );

    Are you moving jquery-migrate to the CDN also?

    Suggestion: move your js to the bottom of your html. You can do it with a plugin or manually in the functions.php

    Frank

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