Skip to content

Instantly share code, notes, and snippets.

@SitesByYogi
Created July 24, 2022 18:24
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 SitesByYogi/14c042bf14418bdb3e3f9c66f6e0e955 to your computer and use it in GitHub Desktop.
Save SitesByYogi/14c042bf14418bdb3e3f9c66f6e0e955 to your computer and use it in GitHub Desktop.
Adds a custom functions file to your wordpress file struction. Be sure to create a new folder and connect it.
<?php
//=========================================================
// Add Custom functions file to WordPress
//=========================================================
$roots_includes = array(
'/theme-functions/theme-colors.php'
);
foreach($roots_includes as $file){
if(!$filepath = locate_template($file)) {
trigger_error("Error locating `$file` for inclusion!", E_USER_ERROR);
}
require_once $filepath;
}
unset($file, $filepath);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment