Created
May 16, 2013 15:15
-
-
Save raideus/5592475 to your computer and use it in GitHub Desktop.
Anti-caching tactic for stylesheets and scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function gs_scripts_styles() { | |
$version = '1'; | |
if (defined('WP_DEBUG') && WP_DEBUG) $version = date('his'); | |
elseif (defined('ENV_STAGING') && ENV_STAGING) $version = date('his'); | |
wp_enqueue_style( 'gs-theme-styles', get_template_directory_uri() . '/style.css', array('gs-grid-styles'), $version, 'all' ); | |
wp_enqueue_script( 'gs-scripts', get_template_directory_uri() . '/js/scripts.js', array( 'modernizr', 'jquery' ), $version, true ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment