Created
December 20, 2019 10:20
-
-
Save friedow/52b8bfcb1782ab5460b368f236cf9390 to your computer and use it in GitHub Desktop.
Wordpress - enqueue styles with dynamic version
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
function theme_enqueue_styles() { | |
$stylesheet_url = get_stylesheet_directory_uri() . '/style.css'; | |
$stylesheet_date_modified = date( 'YmdHi', filemtime( $stylesheet_url ) ) | |
wp_enqueue_style( 'theme-slug-style', $stylesheet_url, array( 'iron-master' ), $stylesheet_date_modified, 'all' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment