Last active
January 25, 2021 19:32
-
-
Save shrinkray/8876ed055b05c81acd4a063792d8e3c3 to your computer and use it in GitHub Desktop.
Add modular function partials to the function.php for a customized WordPress child theme
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
/** | |
* Theme Includes | |
* | |
* The $theme_includes array determines the code library included in your theme. | |
* Add or remove files to the array as needed. Supports child theme overrides. | |
* @parent shopical pro from AF Themes | |
* | |
* Please note that missing files will produce a fatal error. | |
* | |
*/ | |
$theme_includes = [ | |
'lib/assets.php', // Scripts and stylesheets | |
'lib/setup.php', // Theme setup | |
'lib/woocommerce.php', // WooCommerce Functions | |
]; | |
foreach ($theme_includes as $file) { | |
if (!$filepath = locate_template($file)) { | |
trigger_error(sprintf(__('Error locating %s for inclusion', 'shopical-pro'), $file), 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