Posted By

vagrantradio on 12/15/10



Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Add version to WordPress theme CSS file.

 / Published in: PHP

Very useful line of code that I'm using very often to prevent old and cached CSS file being served to visitors. You just need to use timestamp of the file.

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

Report this snippet  

You need to login to post a comment.