Archived topic
Creating a customized 404 page
13 replies · Started by Jodie on April 17, 2022
Hi there
I am using the GeneratePress child theme and want to know how I can create a 404 page.
Currently I am using Elementor's 404 template but I am in the process of removing it from my site.
I have searched topics here and also the support documentation but still unclear how a 404 page is created with Generate Press
As always I appreciate your help.
Cheers Jodie
Hi Jodie,
You can create a custom 404 page by creating a 404.php file in the folder of your child theme.
You may opt to copy and then modify the content of the 404.php file in GeneratePress theme as well: https://github.com/tomusborne/generatepress/blob/master/404.php
Hope this clarifies. Kindly let us know if further assistance is needed. :)
Hi Fernando
Thanks so much for providing this information.
So the code that is in the link above, do I copy all that over? That is the 46 lines?
Yes, you may copy all of that, then add your modifications after. This would be easiest to make sure everything works.
You may also create something from scratch, if you prefer. It would be good to include the hooks found in the parent 404 page.
Hope this clarifies. :)
Thanks Fernando
When you say hooks found in the parent 404 page, where would I find them?
It’s the one I linked: https://github.com/tomusborne/generatepress/blob/master/404.php
It also utilizes this through generate_do_template_part: https://github.com/tomusborne/generatepress/blob/master/content-404.php
Hope this clarifies. :)
Thanks very much Fernando.
You’re welcome Jodie! Glad to be of assistance! Feel free to reach out anytime you’ll need assistance with anything else. :)
Hi Fernando
UPDATE : I think I just worked it out! I changed the colors in the button settings in Customize.
I've removed the Elementor template for 404 on my site and it has reverted back to the GeneratePress version for 404.
The Search button that is next to the Search field is not visual but when I hover over that space the mouse changes to a hand.
I wondered how I could get the search button to show up please?
Yes, the color should be changeable in Appearance > Customize > Colors > Buttons > Background.
Glad you were able to figure it out! Feel free to reach out anytime you’ll need assistance with anything else. :)
Cheers Fernando :)
Cheers Jodie! :)
Dear Fermando -
the 404.php has been added to my child theme.
Then how can I modify the content of this template ?
I would like to be able to edit the metadata as well.
not sure how to proceed.
thx
Hi there,
can you raise a new topic, and give us a little more info on what metadata needs changing