Ensure CSS or JS is fresh on each save

function my_scripts_and_styles(){
  $cache_buster = date("YmdHi", filemtime( get_stylesheet_directory() . '/style.css'));
  wp_enqueue_style( 'main', get_stylesheet_directory_uri() . '/style.css', array(), $cache_buster, 'all' );
}
add_action( 'wp_enqueue_scripts', 'my_scripts_and_styles', 1);
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x