Skip to content

Instantly share code, notes, and snippets.

@philbirnie
Created August 23, 2020 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philbirnie/2080d665586aca4122b8c92a7ad2bb9d to your computer and use it in GitHub Desktop.
Save philbirnie/2080d665586aca4122b8c92a7ad2bb9d to your computer and use it in GitHub Desktop.
Enqueing via last modified
<?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