Tutorial to force CSS changes and “go live” immediately


Sponsored Links




Why we need to Force CSS changes to “go live” immediately? As Web / WordPress designer we are even found some terrible problem. The problem is about internet / proxy cache in our system or ISP (Internet Services Provider) this is terrible bad news, if we develop/designed this site in live server.

Force Reload CSS in WordPress - Cansei Der Se Sexy

Force Reload CSS in WordPress - Cansei Der Se Sexy

One way to solve this is to “version” your CSS file, by adding ?v=123 to the URL in the
to your stylesheet. This is rather a pain to have to do by hand every time, so here is a much better way

That’s what Mark Jaquith said on their blog, so to avoid and Force CSS changes we need to put some code in our style.css, so he we go to do this

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" media="screen, projection" />

The Second Tricks, is using add_filter method. Just write down this code below on your theme functions.php

add_filter('stylesheet_uri', create_function('$s', 'return $s . "?" . filemtime( get_stylesheet_directory() . "style.css"");'));

So simple right? this simple code added giant impact for cache system, so the proxy cache or whatever it said, will always updated the style.css we the version has been changed.

So what does the filemtime function do? From the PHP website:

This function returns the time when the data blocks of a file were being written to, that is, the time when the content of the file was changed.

We hope today WP Tricks about To Force CSS changes to “go live” immediately useful for you. You can use CSS Cache Buster too to avoid this problem

Photos by Lisa Carpenter (001) 212 962 0060

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

Force CSS changes to “go live” immediately | Mark on WordPress

107 thoughts on “ Force CSS changes to “go live” immediately ” and posted tutorial outputs like this href=”http://127.0.0 Read More

Create Custom Page with Custom Loop and Query / WordPress Tricks

Daily The Best WordPress Tricks and WordPress Tips to Tutorial to force CSS changes and “go live” immediately Read More

CSS - How To Information | eHow.com

How to Make CSS Go Live Immediately Changes that you make to give yourself an edge when playing "Counter-Strike: Source" (CSS As CSS becomes a driving force is new Read More

MediaWiki talk:Common.css/Archive 3 - Wikipedia, the free encyclopedia

Most changes to templates go live immediately: all the appropriate pages are just purged from cache I'd be happy with banning template-specific styling to force the Read More

WordPress 24-Hour Trainer; Watch, Read, and Learn How to Create

make some changes. so let’s look at how CSS can control the colors the look of your site using cascading style sheets the image. and the default is immediately. In Read More


2 Responses to Tutorial to force CSS changes and “go live” immediately

  1. There was a time when i used to have many problems with caching, but letely i didn’t experienced so many problems.

    A good browser and a good DNS can solve it.

    I’m using Chrome and Firefox as browser and i’ve set my DNS to use Google DNS which is: 8.8.8.8 and alternative 8.8.8.4

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>