Something i’ve struggled with in the past is how to load a CDN version of jQuery into WordPress, but ensure that it’s the same version that comes loaded with the WordPress core. That way when you update WP or plugins, things won’t break because you’re loading an older version on jQuery.

So this is what I came up with, it includes a fallback that calls the bundled WP jQuery if the CDN isn’t available:

function jquery_cdn(){
	if( !is_admin() ) {
		// Get the WP built-in jquery version number
		$wp_jquery_ver = $GLOBALS['wp_scripts']->registered['jquery']->ver;

		// Just in case it doesn't work, add a fallback plan
		$jquery_ver = ( $wp_jquery_ver == '' ) ? '1.8.3' : $wp_jquery_ver;

		// Now de/re-register jQuery
		wp_register_script( 'jquery', '//'. $jquery_ver .'/jquery.min.js' ); // I load jQuery in the head just to be safe. Change to footer as desired
		wp_enqueue_script( 'jquery' );
add_action( 'wp_enqueue_scripts', 'jquery_cdn' );

// Add core WP jquery fallback if CDN is unavailable
function jquery_fallback() {
	echo '<script>window.jQuery || document.write(\'<script src="' . includes_url( 'js/jquery/jquery.js' ) . '"><\/script>\')</script>' . "\n";
add_action( 'wp_head', 'jquery_fallback' );