0

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

3
  • Seems to be a css file for some sort of ratings plugin. wp_enqueue_script and wp_print_scripts have nothing to do with stylesheets. Have you tried simply disabling the plugin? Commented Jan 18, 2015 at 4:25
  • The problem is that I need this plugin enabled. I just don't need inclusion of old jQuery file in the website header. Commented Jan 19, 2015 at 5:29
  • No idea what you are doing. Explanation is not understandable so far Commented Jan 19, 2015 at 14:03

1 Answer 1

2

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');
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your reply. But wp_enqueue_script('jquery') will load jQuery file supplied by wordpress by its own(jQuery from wp-includes) while I want to load jQuery file from external source with my custom in website header

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.