Skip to content

Commit

Permalink
Cachebuster
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredwsmith committed Sep 25, 2019
1 parent 4cb4852 commit 3ffb935
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

function register_stylesheet()
{
wp_enqueue_style('chswx-css', get_template_directory_uri() . '/css/responsive-style.css', false, 'all');
wp_enqueue_style('chswx-css', get_template_directory_uri() . '/css/responsive-style.css', array(), chswx_get_css_sha(), 'all');
}
add_action('wp_enqueue_scripts', 'register_stylesheet');

Expand Down Expand Up @@ -164,3 +164,12 @@ function chswx_get_wind_direction($dir)

return "";
}

function chswx_get_css_sha()
{
if (file_exists(ABSPATH . 'css-hash')) {
return file_get_contents(ABSPATH . 'css-hash');
}

return false;
}

0 comments on commit 3ffb935

Please sign in to comment.