Architecture
Directory structure
Section titled “Directory structure”Parent theme (core framework)
Section titled “Parent theme (core framework)”wage/├── functions.php # Loads bootstrap├── style.css # Theme header├── index.php # Required fallback└── inc/core/ ├── bootstrap.php # Theme setup, asset loading, WP cleanup ├── flags.php # Feature flags (wireframe, components, etc.) ├── components.php # Reusable PHP component functions (wage_*) ├── seo.php # SEO engine ├── forms.php # Form handler (spam, validation, email, storage) ├── styleguide.php # Built-in dashboard (style guide, components, SEO) └── css/ ├── tokens.css # Default design tokens (neutral defaults) └── core.css # Reset, structural layout, component skeletonsChild theme (per client)
Section titled “Child theme (per client)”wage-{client}/├── style.css # Theme header with Template: wage├── functions.php # Project setup (fonts, forms, API keys)├── header.php # Site header├── footer.php # Site footer├── front-page.php # Homepage template├── page-*.php # Page templates├── assets/│ ├── css/tokens.css # Brand tokens (overrides parent defaults)│ └── css/site.css # ALL visual styling├── assets/js/main.js # Project JS├── inc/│ ├── wage-components.php # Project-specific components (can override core)│ └── seo-data.php # Project SEO data├── data/ # Protected file storage├── CLAUDE.md # Project instructions└── SETUP.md # New project checklistKey paths
Section titled “Key paths”| Constant / Function | Points to |
|---|---|
get_template_directory() / WAGE_CORE_DIR | Parent theme (core) |
get_stylesheet_directory() / WAGE_CHILD_DIR | Child theme (project) |
WAGE_IS_CHILD | true when a child theme is active |
CSS load order
Section titled “CSS load order”Assets load in this order so that overrides cascade correctly:
wage-tokens—inc/core/css/tokens.css(neutral defaults)wage-core—inc/core/css/core.css(framework structural styles){client}-tokens—assets/css/tokens.css(brand overrides){client}-site—assets/css/site.css(all visual styling)
PHP load order
Section titled “PHP load order”require_once .../inc/core/components.php; // wage_* functionsrequire_once .../inc/wage-components.php; // project overridesThe child’s wage-components.php loads before core checks function_exists(), so project overrides take priority automatically.
- Never put project-specific code in the parent theme. It gets shared across all sites.
- Core CSS is structural only. All visual styling lives in the child’s
site.css. - All
wage_*functions usefunction_exists()guards so child themes can override them. - Child’s
wage-components.phploads before core so overrides work automatically.
Updating core
Section titled “Updating core”Push changes to the parent theme repo. Pull on each server. Child themes are unaffected — they inherit the updated core.