Created
January 2, 2017 04:18
-
-
Save edward-jimenez/169dcca4f60922b43ef9a9d17d474585 to your computer and use it in GitHub Desktop.
Removes the version of your css and javascript files to speed up performance
This file contains hidden or 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
/* | |
Put the following function in your functions.php file to remove the query strings from css and javascript files | |
*/ | |
function prefix_remove_script_and_style_version( $src ){ | |
$ver = explode( '?ver', $src ); | |
return $ver[0]; | |
} | |
add_filter( 'script_loader_src', 'prefix_remove_script_and_style_version', 15, 1 ); | |
add_filter( 'style_loader_src', 'prefix_remove_script_and_style_version', 15, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment