Skip to content

Config

The config/ directory holds all the settings a developer is likely to touch on a project. Each file is a plain PHP array — no classes, no side-effects, just data.

When the theme boots, every config/*.php file is loaded into memory. After that, each provider runs its boot() method and reads whatever values it needs via Config::get().

config/theme.php ──▶ ThemeProvider::boot() ──▶ add_theme_support(), register_nav_menu(), …
config/hooks.php ──▶ HooksProvider::boot() ──▶ instantiates and registers Hook classes
config/assets.php ──▶ AssetsProvider::boot() ──▶ registers Vite entrypoints, extra scripts, …

Providers are the only place that calls WordPress functions — config files never do.

Use Config::get() with dot notation anywhere in the theme:

$support = Config::getInstance()->get('theme.support');
$sizes = Config::getInstance()->get('images.sizes');

The first segment is the filename (without .php), the rest traverse the array.

The following config files are available out of the box. Follow the links for a full reference of each option.

FileDescription
acf.phpACF options pages
ajax.phpAJAX action registration
assets.phpVite entrypoints, extra scripts and styles
cache.phpCaching settings
custom-post-types.phpCustom post type definitions
custom-taxonomies.phpCustom taxonomy definitions
hooks.phpHook class registration
i18n.phpInternationalisation strategy
images.phpImage sizes and crop settings
rest-api.phpREST API route registration
theme.phpTheme support, nav menus, sidebars
timber.phpTimber / Twig settings