Monday, January 5, 2015

How to replace wordpress default jQuery with Google Library jQuery

Wordpress load jQuery library from the wordpress project stored script. So if we want to load jQuery form Google Library then we need to create a simple function which load jQuery from google library and also stop lode jquery from wordpress default location. That means we want to replace the loading way of jQuery way form wordpress default to Google library. The function is following -

//Create function to load jQuery from Google Library
function replace_jquery() {
if (!is_admin()) {
// comment out the next two lines to load the local copy of jQuery
wp_register_script('jquery', '', false, '1.11.1');
add_action('init', 'replace_jquery');


Post a Comment


Copyright @ 2014 Tech Tutorial .