Skip to content

Instantly share code, notes, and snippets.

Avatar
🤗

Alexander Karlstad carestad

🤗
View GitHub Profile
@carestad
carestad / cssversioner.php
Created Oct 5, 2012 — forked from vidluther/cssversioner.php
Add a query string to the end of the theme's style.css when WordPress is loaded.
View cssversioner.php
<?php
/**
* Add a filter to stylesheet_uri, which appends a query string to it automagically.
*/
add_filter('stylesheet_uri', function($css) {
$parts = parse_url($css);
$file = $_SERVER['DOCUMENT_ROOT'] . $parts['path'];