Frontend Runtime
This file explains the shared frontend flow before page-specific templates start rendering.
Entry points:
- wp-content/themes/balinot/header.php
- wp-content/themes/balinot/footer.php
- wp-content/themes/balinot/page.php
- wp-content/themes/balinot/home.php
Shared wrapper flow:
- header.php opens the HTML document, calls wp_head(), opens body, and loads templates/partials/header.
- footer.php closes content wrappers, loads templates/partials/footer, and calls wp_footer().
- Page templates and fallback templates render inside that shared shell.
Global hooks already available:
- balinot_before_header
- balinot_after_header
- balinot_inside_content
- balinot_before_footer
- balinot_after_footer
These are the safest extension points when you need shared injections without rewriting header.php or footer.php.
Header responsibilities:
- File: wp-content/themes/balinot/templates/partials/header.php
- Reads global logos, socials, and contact data from balinot_theme_option_group().
- Renders desktop header, mobile drawer, menu-primary, menu-mobile, CTA, WhatsApp float, and Woo cart sidebar hooks.
- Uses menu location fallback from mobile to primary when needed.
Important header behavior:
- The header is fixed and uses a spacer element to avoid layout jumps.
- Woo contexts can add a static white header body class through helpers from functions.php.
- Some JS behaviors depend on required data attributes already printed by the header partial and its menu partials.
Footer responsibilities:
- File: wp-content/themes/balinot/templates/partials/footer.php
- Usually consumes the same global contact, social, and logo groups used by the header.
- Should remain a shared partial, not page-specific markup.
When to edit the shared frontend runtime:
- Change header or footer content used across the site.
- Add a shared body class or hook-based injection.
- Modify global frontend actions such as the cart sidebar, floating actions, or shared wrappers.
When not to edit it:
- If the change belongs to one page template only.
- If the markup is a section that should live in templates/partials/
{page}/. - If the behavior should be loaded only on a specific page through modules/00-enqueue.php.
Good rule:
- Keep header.php and footer.php thin.
- Keep shared UX logic inside templates/partials/header.php, templates/partials/footer.php, or focused runtime helpers.
Last updated on