Skip to content

Instantly share code, notes, and snippets.

@westcoastdigital
Last active December 14, 2017 00:23
Show Gist options
  • Select an option

  • Save westcoastdigital/f202ee5e1bf41cb8d9a4447d3350fb8e to your computer and use it in GitHub Desktop.

Select an option

Save westcoastdigital/f202ee5e1bf41cb8d9a4447d3350fb8e to your computer and use it in GitHub Desktop.
Add version control to css for caching using time stamping
function jm_enqueue_scripts() {
// Gets the last time the style sheet was updated
$version = filemtime( get_stylesheet_directory() . '/style.css' );
// Enqueues style.css and assigns version to ensure browser cache is dropped
wp_enqueue_style( 'arbaros-styles', get_stylesheet_directory_uri() . '/style.css', array(), $version, 'all' );
}
add_action( 'wp_enqueue_scripts', 'jm_enqueue_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment