/ 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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_url'). '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" />