I tried to remove all version string query except for main stylesheet because I often update the stylesheet, and I want it refreshed everytime it’s updated (by manually adding its version)
Here’s how I remove the version
function vc_remove_wp_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
How can I add exception, so main style.css will still show its version
thanks
Simple check for
style.css
not in current source file, It will remove allver
query string from source file except fromstyle.css