Stylesheet Caching

, , ,

This little snippet of code allows for you to update the stylesheet url based on the time it was edited so when you update the stylesheet the url changes and the cached version is no longer the correct version.

<link rel="stylesheet" href="<?php 

	bloginfo( 'stylesheet_url' ); 
	echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); 

	?>" />



Posted on

April 12, 2015

Submit a Comment

Your email address will not be published. Required fields are marked *