it's been suggested to me to use wp_unregister and wp_enqueue to replace wordpress jquery library with a google hosted one (because the wordpress one was having some problems)
However, when i try to insert these into my wordpress site, it breaks my site.
Do I need to wrap them somehow?
wp_unregister_script('jquery');
wp_unregister_script('jquery-ui-core');
wp_enqueue_script('jquery', https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js);
wp_enqueue_script('jquery-ui-core', https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js);
My site has a custom folder where I can put custom functions. I tried this unsuccessfully
function googlejqueryhost(){
<?php
wp_unregister_script('jquery');
wp_unregister_script('jquery-ui-core');
wp_enqueue_script('jquery', https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js);
wp_enqueue_script('jquery-ui-core', https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js);
?>
}
add_action('wp_head', 'googlejqueryhost');
Based on the code I've demonstrated in this blog post, how about this:
I use the template redirect hook, I wonder if that is what is causing your issues.
Either way if this doesn't work can you give more info on the issue, have you got a link to the site?
Edit
Oh, also your function opens up PHP tags when really they should already be open, see my comments...
Edit 2
You'll notice your site is now correctly loading jQuery from Google's CDN, the other script has nothing to do with the jQuery library itself.