Skip to content

feat(customizer): disable the header and the footer for the whole site - #4628

Open
Alexia-Soare wants to merge 8 commits into
developmentfrom
feat/4551
Open

Alexia-Soare wants to merge 8 commits into
developmentfrom
feat/4551

Conversation

@Alexia-Soare

@Alexia-Soare Alexia-Soare commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Users who build their header and footer with a page builder had no way to turn off the theme header and footer for the whole site. The Customizer now has a toggle for each, and a disabled header no longer leaves an empty wrapper on the page.

What changed

bettershot_776F520D-4203-4129-9FAD-E7BB9F773F53 bettershot_18113C57-A5FF-404B-8029-C771F9EBF121 bettershot_75590866-B102-4EE8-A793-7C5F43F9B2DC bettershot_1CA4DEF5-D930-4FD2-B578-5F59C08479FC
  • Header panel — a new Header Visibility section holds a Disable Header Globally toggle. Footer panel — a new Footer Visibility section holds a Disable Footer Globally toggle. Both are off by default.

  • Header markup — the header element is no longer printed when the header is off. Before, the element stayed on the page and held only the skip link. The same change is applied to the block theme template in inc/compatibility/fse.php.

  • Skip link — printed outside the header element, so it stays available when the header is off.

  • Post meta — a page can still turn its own header or footer off. A page can no longer turn one back on against the global toggle.

  • AMP — the amp-state elements move from neve_after_header_hook to neve_after_header_wrapper_hook. One of them drives the WooCommerce shop sidebar, which stays on the page when the header is off.

  • Customizer styles — both new sections are added to the whitelist in _general.scss. The builder panels hide every section they do not name.

Note

The toggle removes the whole header region, and page builders render into that region. Elementor Pro, Header Footer Elementor and Beaver Themer all hook neve_do_header and neve_do_footer, so their headers and footers go away too. This is intended: a user who wants a page builder header leaves the toggle off. Elementor Canvas templates never call get_header(), so they do not change.

Note

The metabox writes off both for an untouched page and for a page that was turned on and off again. The value cannot tell the two apart, so the global toggle wins over it. Issue #4551 lists the per page override as optional.

What decides if the header renders

flowchart LR
    A["Page loads"] --> B{"Post meta<br/>set to on?"}
    B -- yes --> C["No header"]
    B -- no --> D{"Changed:<br/>Disable Header<br/>Globally?"}:::changed
    D -- yes --> E["New:<br/>No header element,<br/>skip link stays"]:::added
    D -- no --> F["Header renders"]

    classDef added fill:#1a7f37,color:#fff,stroke:#116329,stroke-width:3px
    classDef changed fill:#9a6700,color:#fff,stroke:#5c3d00,stroke-width:3px,stroke-dasharray:6 3
Loading

QA

  1. Go to WP Admin → Appearance → Customize → Header. Find the Header Visibility section above Header Presets. Turn on Disable Header Globally and publish.

    Expect: the preview loses the header. No empty gap stays at the top.

  2. Open the site front end in a new tab. Open the page source with Ctrl+U or Cmd+Option+U. Search for <header.

    Expect: no match. Search for neve-skip-link. One match stays.

  3. Open a category archive and a search results page, for example /?s=test.

    Expect: no header on either page. The page metabox never covered these views.

  4. Open a single page in the editor. In the sidebar, open Neve Options. Turn Disable Header on, update, then turn it off and update again.

    Expect: with the global toggle on, the page has no header in both states.

  5. Turn off Disable Header Globally. On the same page, set Disable Header to on and update.

    Expect: this page has no header. Every other page keeps its header.

  6. If WooCommerce is active, set the global toggle on and open the shop archive.

    Expect: no header. The shop archive reads meta from the Shop page, and the global toggle still wins.

  7. Go to WP Admin → Appearance → Customize → Footer. Turn on Disable Footer Globally and publish. Open the front end and search the source for id="site-footer".

    Expect: no match. The page still ends with </body>.

#4551

🤖 Generated with Claude Code

Alexia-Soare and others added 3 commits September 18, 2026 15:38
Add a Disable Header Globally toggle to the Header panel and a Disable
Footer Globally toggle to the Footer panel. Both feed the existing
neve_filter_toggle_content_parts filter, at a priority that runs after
the post meta, so the site wide setting wins.

Move the filter check outside the header element in both templates. The
element used to be printed even when the header was off, which left an
empty wrapper that held only the skip link. The skip link now sits
outside the element, so it survives a disabled header.

The builder panels hide every section they do not name, so both sections
are added to the whitelist in the customizer styles.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The states were printed on neve_after_header_hook, which does not run
when the header is off. One of them drives the WooCommerce shop sidebar,
which stays on the page without a header.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add unit tests for the toggle, its precedence over the post meta, the
markup of both templates and the customizer registration. Add end to end
tests, one of which opens the builder panels, because a section can
register and still be hidden by the panel styles.

Complete the WooCommerce stub with the conditional tags, so tests that
render body_class() after the cart tests do not fatal.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pirate-bot

pirate-bot commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Plugin build for 88baa1e is ready 🛎️!

@Alexia-Soare
Alexia-Soare requested a balanced review from Copilot September 18, 2026 12:43
@pirate-bot

pirate-bot commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

🌍 i18n String Review Report

📊 Summary

Category Count
➕ Added 4
➖ Removed 0
🔄 Changed 0
Total 4
➕ Added Strings (4) - Click to expand
String Location Words Suggested Match
Header Visibility neve/inc/customizer/options... 2 Header
Disable Header Globally neve/inc/customizer/options... 3 Disable Header
Footer Visibility neve/inc/customizer/options... 2 Toggle Visibility
Disable Footer Globally neve/inc/customizer/options... 3 Disable Footer
Total 10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to run its full agentic suite in this review.

Pull request overview

Adds global header/footer visibility toggles, ensuring disabled parts don’t leave empty wrappers behind and that related compatibility output (AMP/FSE) still renders correctly.

Changes:

  • Introduces Customizer controls for globally disabling the header and/or footer.
  • Implements a global visibility filter and updates header/FSE rendering to drop wrappers while preserving the skip link.
  • Adds unit + e2e coverage and extends test stubs for WooCommerce/AMP conditionals.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test-neve-global-header-footer.php Adds PHPUnit coverage for global toggles, markup expectations, Customizer registration, and AMP/FSE interactions.
tests/stubs/woocommerce-cart.php Extends WooCommerce stub with additional conditional tag functions used by the theme.
tests/stubs/amp.php Adds minimal AMP endpoint stub for AMP-mode rendering in tests.
inc/views/tweaks.php Adds a late-running filter enforcing global header/footer visibility settings.
inc/customizer/options/header_footer_visibility.php Registers new Customizer sections/controls for global header/footer visibility.
inc/customizer/loader.php Loads the new Customizer options module.
inc/compatibility/fse.php Adjusts FSE header output to avoid empty wrappers and keep skip link outside the header.
inc/compatibility/amp.php Moves AMP state rendering to a wrapper-level hook so it persists without the header.
header.php Adjusts classic theme header output to avoid rendering header wrapper when disabled; keeps skip link.
e2e-tests/specs/customizer/header-footer-visibility/header-footer-visibility.spec.ts Adds Playwright coverage for Customizer controls visibility and front-end behavior.
assets/apps/customizer-controls/src/scss/_general.scss Whitelists new Customizer sections so they’re visible in the builder panels.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/test-neve-global-header-footer.php
Comment thread tests/test-neve-global-header-footer.php
Comment thread header.php Outdated
Comment thread tests/test-neve-global-header-footer.php
Comment thread tests/test-neve-global-header-footer.php
Comment thread tests/test-neve-global-header-footer.php
Comment thread tests/test-neve-global-header-footer.php
Comment thread tests/test-neve-global-header-footer.php
The test case restores the hooks and rolls back the database, but it does
not touch $wp_customize. Keep the previous value and put it back, the way
the metabox test does with the REST server.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to run its full agentic suite in this review.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.

Comment thread header.php Outdated
Comment thread inc/compatibility/fse.php
Comment thread tests/test-neve-global-header-footer.php Outdated
Comment thread inc/customizer/options/header_footer_visibility.php Outdated
Comment thread inc/customizer/options/header_footer_visibility.php Outdated
Comment thread inc/views/tweaks.php
Hold the panel, the section title and the control label in one array per
part, in place of two ternaries.

Assert on the toggle structure in the e2e spec, not on the English label.
Check that the stylesheet exists before the test reads it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to run its full agentic suite in this review.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Comment thread header.php Outdated
Comment thread inc/compatibility/fse.php
Comment thread tests/test-neve-global-header-footer.php
Comment thread tests/test-neve-global-header-footer.php
Drop the hook docblock copied into header.php. footer.php documents this
filter and the block theme template carries none.

Keep only the part of the filter docblock a reader cannot infer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to run its full agentic suite in this review.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Comment thread header.php Outdated
Comment thread inc/compatibility/fse.php
Comment thread header.php Outdated
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to run its full agentic suite in this review.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Comment thread header.php
Comment thread inc/compatibility/fse.php
Comment thread inc/views/tweaks.php
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pirate-bot

Copy link
Copy Markdown
Collaborator

🤖 Review agent — queued ⏳ on 88baa1e0

Run code-review-agent_6aad420895fdc0.02311310 · trail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants