user379888
user379888

Reputation:

How can I install jQuery on WordPress?

Please tell me how can I install jQuery on a WordPress blog? I need jquery 1.8.3 but Google provides all others than that. Will jquery 1.8.4 work instead of 1.8.3? https://developers.google.com/speed/libraries/devguide

Upvotes: 1

Views: 480

Answers (1)

Gerald Hughes
Gerald Hughes

Reputation: 6159

The following is the best way to go about it. Add the following to the theme's functions.php file:

if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
   wp_deregister_script('jquery');
   wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js", false, null);
   wp_enqueue_script('jquery');
}

Or by installing this plugin : https://wordpress.org/plugins/wp-jquery-plus/

Link for jquery 1.8.3 : http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js

Also as Jai mentioned in the comments, version 1.8.4 of jquery doesn't exist

Upvotes: 3

Related Questions