Created
July 6, 2018 20:05
-
-
Save theblanchard/36f7bcf60d41e80460c0fb8e8a66fedf to your computer and use it in GitHub Desktop.
Replace WordPress default jQuery with a version from a CDN.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add to functions.php in your WordPress theme file | |
function jquery_from_cdn() { | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', 'https://code.jquery.com/jquery-3.3.1.min.js', false, '3.3.1'); | |
wp_enqueue_script('jquery'); | |
} | |
add_action('init', 'jquery_from_cdn'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment