updated   : May 15, 2012
we now have 588 snippets
By : , on October 29, 2010 8:00 pm

Prevent cached CSS

wordpress snippet

These are two example to control the caching of CSS for your wordpress theme. The first example appends time() to the end of the file name. The second method simply type ?v=1.0 and change the version number when you update your CSS.

snippet :  PHPcopy
	<style type="text/css" media="screen">
		@import url( <?php bloginfo('stylesheet_url'); ?>?<?php echo time(); ?> );
	</style>
	<style type="text/css" media="screen">
		@import url( <?php bloginfo('stylesheet_url'); ?>?v=1.0 );
	</style>