Created
August 25, 2013 19:48
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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