Alex F
Alex F

Reputation: 183

Disable jQuery added by wordpress plugin

I have a wordpress plugin which automatically adds jQuery "file" line to my website header, e.g.

<link rel='stylesheet' id='wp-postratings-css'  href='http://domain.com/wp-content/plugins/wp-postratings/postratings-css.css?ver=1.8' type='text/css' media='all' />

I don't need this line because it refers to old version of jQuery plus I already have jQuery file included prior. I tried to disable following default wordpress functions "wp_enqueue_script", "wp_print_scripts('jquery')" but it didn't worked.

Any ideas? Thanks

Upvotes: 0

Views: 2240

Answers (1)

Moishy
Moishy

Reputation: 3638

if you add in your functions.php wp_enqueue_script('jquery'); in essence this tells wordpress to load jQuery only once and will ignore any other instances.

to load your own jquery from an external source (example here is google)

wp_deregister_script('jquery');
wp_register_script('jquery', "https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js", false, null);
wp_enqueue_script('jquery');

Upvotes: 2

Related Questions