Last active
December 14, 2017 00:23
-
-
Save westcoastdigital/f202ee5e1bf41cb8d9a4447d3350fb8e to your computer and use it in GitHub Desktop.
Add version control to css for caching using time stamping
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
| 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