Components
WAGE provides a library of reusable PHP functions prefixed with wage_. These render common UI patterns across all client sites.
How components work
Section titled “How components work”All components are defined in inc/core/components.php and wrapped with function_exists() guards:
if (!function_exists('wage_button')) { function wage_button($text, $href, $options = []) { // default implementation }}This means a child theme can override any component by defining the same function in inc/wage-components.php — because the child file loads first.
Available components
Section titled “Available components”| Function | Purpose |
|---|---|
wage_button() | Styled button/link |
wage_badge() | Small label badge |
wage_section_intro() | Section heading with optional subtitle |
wage_trust_strip() | Rotating trust/credibility strip |
wage_whatsapp_cta() | WhatsApp call-to-action block |
Overriding a component
Section titled “Overriding a component”In the child theme’s inc/wage-components.php:
// Override the trust strip with client-specific contentfunction wage_trust_strip() { // Custom implementation with client's icon, headline, phrases}Because the child’s file loads before the core checks function_exists(), the child’s version wins.
Naming conventions
Section titled “Naming conventions”wage_*— generic, reusable across all sites (defined in core){client}_*— project-specific components or thin wrappers (defined in child theme)
Adding new components
Section titled “Adding new components”- If the component is reusable across sites, add it to the parent theme’s
inc/core/components.phpwith afunction_exists()guard. - If the component is project-specific, add it to the child theme’s
inc/wage-components.php.