wordpressSi have your WordPress blog, you’ll surely get tedious from time to time to your server the latest version of jQuery, and go change the call in the header.php time.
With this code, you can always download the latest updated version from CDN servers Google high speed without touching the code again!
Simply include this snippet in the functions.php file of your theme:
if (! is_admin ()) (
wp_deregister_script ( ‘jquery’);
wp_register_script ( ‘jquery’, ( “http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js”), false,”);
wp_enqueue_script ( ‘jquery’);
This code searches for the latest jQuery on Google, and loading this version from the folder “/ jquery / 1 /” instead of from the folder of the version available on your site.
Use this code carefully, making sure it is compatible with their scripts. And if you see one that does not work, just erase the lines of code added.