Skip to content

Instantly share code, notes, and snippets.

@alexpos
Created May 29, 2013 17:54
Show Gist options
  • Save alexpos/5672283 to your computer and use it in GitHub Desktop.
Save alexpos/5672283 to your computer and use it in GitHub Desktop.
Versioning WordPress style
/**
* Enqueue scripts and styles
*/
function version_id() {
if ( WP_DEBUG )
return time();
$my_theme = wp_get_theme();
$thversion = $my_theme->Version;
return $thversion;
}
function stout_scripts() {
wp_register_style('style', get_template_directory_uri() . '/css/style.css', array(), version_id(), 'all');
wp_enqueue_style('style');
wp_enqueue_style('googlefonts','http://fonts.googleapis.com/css?family=Open+Sans:200,400,700,600',array(),'1','all');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment