Created
November 20, 2014 15:56
-
-
Save keithdevon/47cf75e5ed55a628b053 to your computer and use it in GitHub Desktop.
WordPress script and style cache busting!
This file contains 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
add_action('wp_enqueue_scripts', 'load_your_css'); | |
function load_your_css(){ | |
if(!is_admin()){ | |
$css_link = get_stylesheet_directory_uri() . '/style.css'; | |
$css_file = get_stylesheet_directory() . '/style.css'; | |
wp_enqueue_style('theme-style', $css_link, array(), filemtime($css_file), 'all'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment