wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

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>
snippet :  PHPcopy
	<style type="text/css" media="screen">
		@import url( <?php bloginfo('stylesheet_url'); ?>?v=1.0 );
	</style>

Did you like this post? If so please share it with your friends. Thanks!

  • jakblak

    If anyone wants to get multiple stylesheets working without cache you can try this
    <link rel="stylesheet" href="” type=”text/css” media=”screen, projection” />