WordPress tutorials: Prevent cached CSS

Wpsnipp – 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.

 

 

<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>

Be Sociable, Share!

Leave a comment