Hello,
I’m trying to create a custom 404 system page using a child theme in HubSpot.
My goal is only to customize the content of the 404 page, while keeping the exact same header (menu) and footer as the parent theme.
Here is the situation:
- We have a parent theme where the 404 page works correctly and displays a specific header and footer.
- We created a child theme and copied the 404 template into it to customize the content.
- Once the 404 is in the child theme, the header and footer are no longer identical to the parent theme, or do not appear at all, even when extending the same base layout or including the same partials.
What we want to achieve:
- Use a child theme
- Customize only the 404 page content
- Keep the parent theme’s header and footer exactly as-is (same menu, same styling, same structure)
Could you please clarify:
- Whether it is technically possible in HubSpot for a system 404 page in a child theme to reuse the parent theme’s header and footer without duplicating them
- If not, what is the recommended best practice from HubSpot to customize a 404 page while preserving the parent theme navigation and footer
We want to stay aligned with HubSpot’s intended architecture and avoid unnecessary duplication or maintenance issues.
Thank you for your help.
Mathieu
Hello @MLancelle,
Thanks for posting in the Community!
I see that you’re looking to understand if a Child Theme can inherit the Parent Theme’s header and footer without file duplication. If not, what’s the standard process for managing this?
I couldn’t find this specifically outlined in our Dev Docs on Child Themes here. With this in mind, I’d like to tag in some of our Top Contributors to see if they have any past experience with this -- @karstenkoehler, @danmoyle, @CarolinaDeMares
Do you have any suggestions for @MLancelle?
Thank you!
Sam, Community Manager
Hi,
Yes it’s exactly what Im’ looking, getting header and footer with all their configs, links and so on from parent theme into the child them for my 404 page because in the theme I bought I cannot edit the 404 page into parent theme (Theme called : Generator - https://drivewebstudio.com/hubspot-themes/generator).
And I just want to set a custom content and keep header and footer the same as parent theme (theme applied on our website linked to Hubspot). The support of this theme is not free anymore for us.
Thanks a lot for your help!
Best regards,
Mathieu
Hi @MLancelle !
In HubSpot, a child theme can reuse the parent theme’s header and footer, because child themes inherit all parent files unless you override them at the same relative path. So ideally, you should only override the 404 template content, not duplicate shared layout parts.
Best practice is to keep the header/footer in a base layout or global partial, and in your child theme’s 404 template use {% extends %} + {% block %} to override only the body content. HubSpot explicitly recommends global partials for elements like headers and footers, see more reference here: Child Themes - HubSpot docs
Also make sure your custom template is still selected as the active system 404 page under settings> content > pages > system pages, since HubSpot system pages must be assigned there.
So yes, it’s possible, but the key is: don’t copy header/footer into the child theme, instead inherit them through the parent layout and override only the 404 content block.
Hope this help, and you need extra support on this on ZUID we can defently help!
Hi @CarolinaDeMares ,
I deleted my child theme in HubSpot and recreated one based on the parent theme, only setting the path to 404.html, but it still doesn’t work. What should I change in my code or in my folder structure?