Skip to content

Components

WAGE provides a library of reusable PHP functions prefixed with wage_. These render common UI patterns across all client sites.

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.

FunctionPurpose
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

In the child theme’s inc/wage-components.php:

// Override the trust strip with client-specific content
function 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.

  • wage_* — generic, reusable across all sites (defined in core)
  • {client}_* — project-specific components or thin wrappers (defined in child theme)
  1. If the component is reusable across sites, add it to the parent theme’s inc/core/components.php with a function_exists() guard.
  2. If the component is project-specific, add it to the child theme’s inc/wage-components.php.