WordPress Css-versioning

Versioning based on the file’s last modified time. When the style.css file is updated on the server, WordPress will append the appropriate timestamp, so there’s no need to refresh the cache with ctrl-r (or ctrl-f5). Note: don’t use time() as the 4th parameter or append it to the file, as this will break caching in almost all cases.

wp_enqueue_style( 'wpmakan-style', get_template_directory_uri() . '/style.css', array(), filemtime(get_template_directory() . '/style.css'), false);

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=""> <s> <strike> <strong>

© 2020 Jakob Helmer - Powered by WordPress - @trails&tribulations