Hi,
I advise you to NOT hardcode script calls in your theme. WordPress has a dedicated routine for that: https://codex.wordpress.org/Function_Reference/wp_enqueue_script
This is the recommended way to include script files, even for those from CDN and the only way to avoid conflicts with plugins that need jQuery or other libraries.
By far the easiest way to get jQuery from an external CDN is to remove that hardcoded line and install the plugin http://wordpress.org/extend/plugins/use-google-libraries/ or any of the other ones that provide this function. These plugins will make ANY library (not only jQuery) that will be needed by any other plugin now and in the future be taken from Google’s CDN. So you’re safe for the future as well 😉
Thread Starter
Anonymous User 4104441
(@anonymized-4104441)
To those who doesn’t want to waste time by reading manuals, place this into your functions.php:
// Load jQuery from CDN
function my_scripts_method() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
wp_enqueue_script( 'jquery' );
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
Thread Starter
Anonymous User 4104441
(@anonymized-4104441)
and if you want to include your own script, use this code, just change the path and name for .JS:
// Load my Script
function myScript() {
wp_enqueue_script('jquery');
wp_enqueue_script('zion', '/js/zion.js', array('jquery'));
}
add_action('init', 'myScript');