Skip to content

Instantly share code, notes, and snippets.

@vajrasar
Created September 15, 2017 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vajrasar/cf77bf9a041bef45077c3cb84d369ef6 to your computer and use it in GitHub Desktop.
Save vajrasar/cf77bf9a041bef45077c3cb84d369ef6 to your computer and use it in GitHub Desktop.
Add dynamically updating version on file
<?php
/* Whenever the theme style file will update on server, this file version
* will automatically update
* Ref - https://developer.wordpress.org/reference/functions/wp_enqueue_style/#comment-2056
*/
wp_enqueue_style('main-styles',
get_template_directory_uri() . '/css/style.css',
array(),
filemtime(get_template_directory() . '/css/style.css'),
false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment