Last active
February 7, 2019 16:49
-
-
Save gtempesta/e304fcbbd43d70e671693af5d157fde6 to your computer and use it in GitHub Desktop.
Force CSS changes to go live in a child theme in Wordpress
This file contains hidden or 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 | |
// Enqueue child theme styles (typically in functions.php) | |
function update_child_theme_styles() { | |
// Force CSS changes to go live | |
wp_enqueue_style( '--child-theme-name--', | |
get_stylesheet_directory_uri() . '/style.css', | |
array(), | |
filemtime( get_stylesheet_directory() . '/style.css' )); | |
} | |
add_action( 'wp_enqueue_scripts', 'update_child_theme_styles', 1000 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment