Archived topic
404 page files
5 replies · Started by Philip on August 24, 2022
Hi Folks,
I noticed that the GeneratePress theme has two 404-related files:
1. 404.php
2. content-404.php
What is the difference between the two files, and how are they related?
Thanks.
Phil
-----
Host: WP Engine
Server: Nginx
PHP: 8.0.20
WordPress: 6.0.1
GeneratePress theme: 3.1.3 with starter child theme
GP Premium: 2.1.2
GenerateBlocks Pro: 1.3.0
Hi there,
404.php includes the header/footer/content which is the template for the entire 404 page.
content-404.php is the template for the content area of the 404 page.
404.php uses content-404.php as its content template.
Understood. Thanks.
So, if I wanted to modify the 404 content only (title, text), could I just copy the content-404.php file to my child theme?
Or, is there a more efficient way?
Phil
So, if I wanted to modify the 404 content only (title, text), could I just copy the content-404.php file to my child theme?
Yes, if you are already using a child theme, this would be the easiest way :)
Okay. Thanks again.
No problem :)