I usually split my theme’s functions into several files as well, and include those in my functions.php
, like so:
// load helper functions
require_once get_stylesheet_directory().'/inc/helper-functions.php';
// load admin functions
if (is_admin())
require_once get_stylesheet_directory().'/inc/admin-functions.php';
// load theme functions
require_once get_stylesheet_directory().'/inc/theme-functions.php';
// load post functions
require_once get_stylesheet_directory().'/inc/post-functions.php';
// load WooCommerce functions
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins'))))
require_once get_stylesheet_directory().'/inc/woocommerce-functions.php';
Why isn’t this working for you?
If you are talking about bulk including, you might have a look at glob
and the like…