Skip to content

Instantly share code, notes, and snippets.

@deanoakley
Last active April 7, 2020 05:04
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 deanoakley/fa24d3e0aa52ef5e7f78bcea16f1232a to your computer and use it in GitHub Desktop.
Save deanoakley/fa24d3e0aa52ef5e7f78bcea16f1232a to your computer and use it in GitHub Desktop.
Easy theme overrides for when updates a site with a build process.
<?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