Skip to content

Instantly share code, notes, and snippets.

@livingston
Created April 29, 2010 12:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save livingston/383512 to your computer and use it in GitHub Desktop.
Save livingston/383512 to your computer and use it in GitHub Desktop.
Cleanup Wordpress Header & use Google Hosted jQuery
<?php
/* Cleanup Wordpress Header & use Google Hosted jQuery */
function cleanUp() {
function restatement_scripts_unversion($src) {
if( strpos($src,'ajax.googleapis.com') )
$src=remove_query_arg('ver', $src);
return $src;
}
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'bloginfo');
wp_deregister_script('jquery');
wp_register_script('jquery', ('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'), false, false, true);
wp_enqueue_script('jquery');
add_filter('script_loader_src','restatement_scripts_unversion');
}
add_action('init', 'cleanUp');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment