add version number to style.css in custom theme
-
I’m only doing this during development. It’s to keep any browser from caching the custom theme stylesheet.
function css_versioning() { wp_enqueue_script( 'style-css', get_stylesheet_directory_uri() . '/style.css' , false,filemtime( get_stylesheet_directory() . '/style.css' ), false ); } add_action( 'wp_print_styles', 'css_versioning' );
What I get in the header is:
<link rel="stylesheet" id="style-css" href="https://mrtwebdesign.local/ddd/wp-content/themes/dlab/style.css?ver=3.5.1" type="text/css" media="all"> <script type="text/javascript" src="https://mrtwebdesign.local/ddd/wp-content/themes/dlab/style.css?ver=1366413348"></script>
I would like to just get the second result. I want to make sure any changes are loading for my client.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘add version number to style.css in custom theme’ is closed to new replies.