Archived topic
Create New 404 Page
5 replies · Started by Sandee on October 20, 2021
Hi,
I'm using generate_do_template_part to create a new 404 page, and for some reason. I'm having trouble adding a header to the page. Is that not an option with generate_do_template_part?
Thank you!
Sandee
Hi Sandee,
Not sure I fully understand your question, your 404 page has a header:
https://www.screencast.com/t/4asEg5DKi
Let me know if I miss anything :)
I don't see it. I had created a header that I toggled off on mobile and another that should appear on desktop, and I don't see either of them. There should be a page header with a navy blue background and the page title in white text, and it's not appearing on any of my devices.
Ah you mean a block element?
Try select after_header as hook name instead, assign it to 404 template as location see if that works.
I got it to appear by adding a container block with a headline block and excluding the 404 template from the other page headers I created, but it's not appearing full-width even though I believe I have it set correctly https://share.getcloudapp.com/p9uNzYmq.
The element is set correctly, but the 404 page itself is not full width.
You can create a layout element, choose 404 templateas location, and set it to full width:
https://docs.generatepress.com/article/layout-element-overview/#content-1