Last active
April 7, 2020 05:04
-
-
Save deanoakley/fa24d3e0aa52ef5e7f78bcea16f1232a to your computer and use it in GitHub Desktop.
Easy theme overrides for when updates a site with a build process.
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 | |
/** | |
* Easy theme overrides for when updating a site with a build process in WordPress | |
* @author Dean Oakley | |
* http://thriveweb.com.au | |
* Add overrides.css and overrides.js to your theme directory and edit away | |
*/ | |
add_action("wp_enqueue_scripts", "theme_overrides", 20); | |
function theme_overrides() { | |
wp_enqueue_script( | |
'js_overrides', | |
get_template_directory_uri().'/overrides.js', | |
null, | |
filemtime( get_stylesheet_directory().'/overrides.js' ), | |
true | |
); | |
wp_enqueue_style( | |
'css_overrides', | |
get_stylesheet_directory_uri().'/overrides.css', | |
array(), | |
filemtime( get_stylesheet_directory().'/overrides.css' ) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment