Last active
November 14, 2018 15:35
-
-
Save benklocek/7206060 to your computer and use it in GitHub Desktop.
Wordpress Functions: Bust cache, register and enqueue stylesheet
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
<?php | |
// cache bust, register, and enqueue main stylesheet | |
$cache_bust = '?'.filemtime( get_stylesheet_directory() . '/css/style.css'); | |
wp_register_style( 'main-stylesheet', get_stylesheet_directory_uri() . '/css/style.css'.$cache_bust, array(), '', 'all' ); | |
wp_enqueue_style( 'main-stylesheet' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment