Kilho.net
IT Ramblings

Using jQuery from Google

Because of traffic, I moved the images and Flash files to another server and linked to them.

While surfing, I found the source code below and connected jQuery to Google.

Modified file: theme/functions.php

[PHP]
//Making jQuery Google API
function modify_jquery()
{
if (!is_admin())
{
// comment out the next two lines to load the local copy of jQuery
wp_deregister_script(‘jquery’);
wp_register_script(‘jquery’,
‘http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js’, false,
‘1.4.4’);
wp_enqueue_script(‘jquery’);
}
}
add_action(‘init’, ‘modify_jquery’);
[/PHP]

Để lại một bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *