Skip to content

Instantly share code, notes, and snippets.

@ChrisCree
Created August 25, 2013 19:48
Show Gist options
  • Save ChrisCree/6335871 to your computer and use it in GitHub Desktop.
Save ChrisCree/6335871 to your computer and use it in GitHub Desktop.
Remove query strings from CSS javascript files. Place this code in the Genesis child theme functions.php file.
<?php
// Don't include opening php tag above
// Remove query strings from css and javascript links
add_filter('script_loader_src', 'wsm_remove_script_version', 15, 1);
add_filter('style_loader_src', 'wsm_remove_script_version', 15, 1);
function wsm_remove_script_version( $src ) {
$parts = explode( '?', $src );
return $parts[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment