Troubleshooting Common Twenty Twenty-Three Theme Header Issues
Content
The Twenty Twenty-Three theme, being a modern block theme, represents a significant shift from traditional WordPress theming. This new approach often leads to confusion, particularly when users try to implement features that worked in classic themes. Based on common community reports, here are the most frequent header-related challenges and their solutions.
1. The Missing header.php File and Editing the <head> Tag
The Problem: Users familiar with classic themes look for a header.php file to add scripts (like GDPR consent code) or CSS links to the <head> section. Twenty Twenty-Three, as a block theme, uses an HTML-based template system and does not have a header.php file.
The Solution: To add code to the <head> tag, you must use the standard WordPress method: the wp_head hook. Add the following code to your child theme's functions.php file, replacing the example with your own script or link tags.
function tt3_child_add_to_head() {
echo '<!-- Your custom script or link tag goes here -->';
}
add_action('wp_head', 'tt3_child_add_to_head');
2. Creating and Managing Child Themes Correctly
The Problem: Many issues arise from incorrectly created child themes. Users report that custom header.html files in their child theme's parts folder are ignored, or that headers/footers disappear entirely upon activation.
The Solution: For block themes, manually creating a child theme often leads to problems. The recommended method is to use the official Create Block Theme plugin. This plugin properly generates a child theme with the correct file structure and ensures template parts are inherited and overridden correctly.
3. Sticky Header Not Working
The Problem: A user enables the 'Sticky' position setting for the header group in the Site Editor, but the header continues to scroll with the page and does not stick to the top.
The Solution: The Sticky position setting applies to the Group block, not the Header template part itself. To fix this:
- In the Site Editor, edit your template (e.g., Page).
- Add a Group block as the first block at the top of the template.
- Move the Header template part inside this new Group block.
- Select the Group block, and in its settings sidebar, set the Position to 'Sticky'.
- Save your changes.
4. Editing Menus and the Navigation Block
The Problem: Users accustomed to the classic Menus screen under Appearance cannot find it and do not know how to reorder menu items.
The Solution: Twenty Twenty-Three uses the Navigation block. To edit a menu:
- Go to Appearance > Editor.
- Edit the Header template part.
- Select the Navigation block within the header.
- Click on the 'Edit' button that appears in the block's toolbar. This will open a panel where you can add, remove, and drag to reorder menu items.
5. Headers Not Appearing on Custom Post Types or WooCommerce Pages
The Problem: Headers and footers render correctly on standard pages and posts but vanish on pages for plugins like WooCommerce or GiveWP.
The Solution: This typically happens when a child theme is active but is missing the necessary template files. These plugins often use custom templates (e.g., single-product.php for WooCommerce). The block theme system must know which header to use on these templates. Ensure your child theme, created with the Create Block Theme plugin, contains all the required templates and template parts. You may need to edit the specific template (e.g., Single Product) in the Site Editor and ensure the Header template part is placed correctly within it.
Conclusion
Many common header issues in the Twenty Twenty-Three theme stem from the paradigm shift to full-site editing and block templates. The key to resolving most problems is to use the correct tools—like the Create Block Theme plugin—and to edit your site's structure directly within the WordPress Site Editor rather than relying on PHP file edits from the classic theming approach.
Related Support Threads Support
-
The default header doesn’t show up on a custom post pagehttps://wordpress.org/support/topic/the-default-header-doesnt-show-up-on-a-custom-post-page/
-
Header and footer problemhttps://wordpress.org/support/topic/header-and-footer-problem-3/
-
Drop Shadow for Headerhttps://wordpress.org/support/topic/drop-shadow-for-header/
-
Sticky Menu Doesn’t Stay at Tophttps://wordpress.org/support/topic/sticky-menu-doesnt-stay-at-top/
-
How to create header with an image and a menu?https://wordpress.org/support/topic/how-to-create-header-with-an-image-and-a-menu/
-
Header Navigation Page Orderhttps://wordpress.org/support/topic/header-navigation-page-order/
-
Header not working properly on postshttps://wordpress.org/support/topic/header-not-working-properly-on-posts/
-
GiveWP Donation Forms Header Issueshttps://wordpress.org/support/topic/givewp-donation-forms-header-issues/
-
Edit mobile & tablet header onlyhttps://wordpress.org/support/topic/edit-mobile-tablet-header-only/
-
Header and Footer Don’t Right-Justify with Custom Page Templatehttps://wordpress.org/support/topic/header-and-footer-dont-right-justify-with-custom-page-template/
-
No file ‘header.php’https://wordpress.org/support/topic/no-file-header-php/
-
How to create a 4 column footer?https://wordpress.org/support/topic/how-to-create-a-4-column-footer/
-
Header and footer does not appear in a child menuhttps://wordpress.org/support/topic/header-and-footer-does-not-appaer-in-child-menu/
-
After export: No header on WooCommerce single product templateshttps://wordpress.org/support/topic/after-export-no-header-on-woocommerce-single-product-templates/
-
adding script to header?https://wordpress.org/support/topic/adding-script-to-header/
-
Alternative Header in other template and disconnect the header?!https://wordpress.org/support/topic/alternative-header-in-other-template-and-disconnect-the-header/
-
Sticky Headers with Gutenberg Twenty Twenty Threehttps://wordpress.org/support/topic/sticky-headers-with-gutenberg-twenty-twenty-three/
-
How to get header’s nav object programmatically?https://wordpress.org/support/topic/how-to-get-headers-nav-object-programmaticall/
-
Template Part with header and sidebarhttps://wordpress.org/support/topic/template-part-with-header-and-sidebar/
-
Childtheme parts-Folder not working – header.htmlhttps://wordpress.org/support/topic/childtheme-parts-folder-not-working-header-html/