-
-
Save richaber/2425183c277fe031ef3311fa7dbec678 to your computer and use it in GitHub Desktop.
Cache Busting
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
<link rel='stylesheet' id='my-custom-style-css' href='https://example.com/wp-content/themes/mycustomtheme/css/customstyle.css?ver=1.0.0' type='text/css' media='all' /> |
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
<link rel='stylesheet' id='my-custom-style-css' href='https://example.com/wp-content/themes/mycustomtheme/css/customstyle.css?ver=1584639960' type='text/css' media='all' /> |
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 | |
/** | |
* Example stylesheet enqueue with manually maintained version number. | |
*/ | |
/** | |
* Enqueue our custom stylesheet. | |
*/ | |
function my_enqueue() { | |
/** | |
* Enqueue our custom theme stylesheet. | |
* | |
* @link https://developer.wordpress.org/reference/functions/wp_enqueue_style/ | |
*/ | |
wp_enqueue_style( | |
'my-custom-style', // handle | |
get_stylesheet_directory_uri() . '/css/customstyle.css', // src | |
[], // deps | |
'1.0.0' // ver | |
); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_enqueue' ); |
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 | |
/** | |
* Example stylesheet enqueue with automagic version number. | |
*/ | |
/** | |
* Enqueue our custom stylesheet. | |
*/ | |
function my_enqueue() { | |
/** | |
* Enqueue our custom theme stylesheet. | |
* | |
* @link https://developer.wordpress.org/reference/functions/wp_enqueue_style/ | |
*/ | |
wp_enqueue_style( | |
'my-custom-style', // handle | |
get_stylesheet_directory_uri() . '/css/customstyle.css', // src | |
[], // deps | |
filemtime( get_stylesheet_directory() . '/css/customstyle.css' ) // ver | |
); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_enqueue' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment