Created
March 27, 2018 13:49
-
-
Save jrobinsonc/a05c6cd0af84f192b78ca14015959314 to your computer and use it in GitHub Desktop.
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
| RewriteEngine On | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule ^(.+)-[0-9]+\.(js|css)$ $1.$2 [L] |
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
| <?php | |
| // Site styles | |
| $css_file = '/css/main'; | |
| $version = filemtime(get_template_directory() . "{$css_file}.css"); | |
| wp_enqueue_style('site-css', get_template_directory_uri() . "{$css_file}-{$version}.css", [], null); | |
| // Site scripts | |
| $js_file = '/js/main'; | |
| $version = filemtime(get_template_directory() . "{$js_file}.js"); | |
| wp_enqueue_script('site-js', get_template_directory_uri() . "{$js_file}-{$version}.js", [], null, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment