Created
October 5, 2017 11:07
-
-
Save jamesmorrison/79924f67e979cea3a89ce4507246611b to your computer and use it in GitHub Desktop.
When enqueueing a script or style, use `filemtime` to set the file version to the Unix timestamp for when the file was last modified
This file contains 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 | |
/* Obviously, add this to a function that hooks into wp_enqueue_scripts() (or admin_enqueue_scripts()) */ | |
wp_enqueue_style( 'main', get_stylesheet_directory_uri() . '/style.css', false, filemtime( get_stylesheet_directory() . '/style.css' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment