Home / cache / Prevent cached CSS
  • How to Prevent cached CSS

    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.

    wordpress snippet : PHP

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

    wordpress snippet : PHP

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

    ( WordPress codex functions, hooks, in this snippet. )

    stylesheet, bloginfo,
  • 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” />