Skip to content

Instantly share code, notes, and snippets.

View carestad's full-sized avatar
🤗

Alexander Karlstad carestad

🤗
View GitHub Profile
@carestad
carestad / cssversioner.php
Created October 5, 2012 19:56 — forked from vidluther/cssversioner.php
Add a query string to the end of the theme's style.css when WordPress is loaded.
<?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'];