Skip to content

Instantly share code, notes, and snippets.

@joshapgar
Created August 3, 2017 15:01
Show Gist options
  • Save joshapgar/a11515a0c60256685fbaafbe791c9fb3 to your computer and use it in GitHub Desktop.
Save joshapgar/a11515a0c60256685fbaafbe791c9fb3 to your computer and use it in GitHub Desktop.
Remove version from styles and scripts, and add time version to style.css
// remove WP version from css
add_filter( 'style_loader_src', 'bones_remove_wp_ver_css_js', 9999 );
// remove WP version from scripts
function bones_remove_wp_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
// register main stylesheet
wp_register_style( 'bones-stylesheet', get_stylesheet_directory_uri() . '/library/css/style.css', array(), time(), 'all' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment