Created
August 23, 2020 17:16
-
-
Save philbirnie/2080d665586aca4122b8c92a7ad2bb9d to your computer and use it in GitHub Desktop.
Enqueing via last modified
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 | |
function my_theme_get_version() { | |
return filemtime( get_template_directory() . '/assets/styles/main.css' ); | |
} | |
function my_theme_setup_styles() { | |
wp_register_style( | |
'main', | |
get_template_directory_uri() . '/assets/styles/main.css', | |
[ ], | |
my_theme_get_version(), | |
); | |
wp_enqueue_style( 'main' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment