Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function load_jquery() {
- // only use this method is we're not in wp-admin
- if (!is_admin()) {
- // deregister the original version of jQuery
- wp_deregister_script('jquery');
- // discover the correct protocol to use
- $protocol='http:';
- if($_SERVER['HTTPS']=='on') {
- $protocol='https:';
- }
- // register the Google CDN version
- wp_register_script('jquery', $protocol.'//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js', false, '1.5.2');
- // add it back into the queue
- wp_enqueue_script('jquery');
- }
- }
- add_action('template_redirect', 'load_jquery');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement