Created
November 21, 2013 18:12
-
-
Save guwordpressbrasil/7586637 to your computer and use it in GitHub Desktop.
Prevenir cache de CSS
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
function url_fresh($url = '', $echo = true){ //http://css-tricks.com/snippets/wordpress/prevent-css-caching/ | |
if($echo){ | |
echo get_stylesheet_directory_uri().'/'.$url.'?r='.filemtime( get_stylesheet_directory().'/'.$url); | |
}else{ | |
return get_stylesheet_directory_uri().'/'.$url.'?r='.filemtime( get_stylesheet_directory().'/'.$url); | |
} | |
} | |
function carrega_scripts() { | |
wp_register_script('bootstrap', url_fresh('js/vendor/bootstrap.min.js',false),array('jquery'),false,false); | |
wp_enqueue_script('bootstrap'); | |
} | |
add_action('wp_enqueue_scripts', 'carrega_scripts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment