WordPress 404.php file is never called
-
Hi,
I’ve been testing my site to make sure everything is in working order, and come to find out, it’s not (big surprise…) Whenever someone tries to go to a non existent page, they get the standard “problem loading page” error, instead of the WordPress 404 page.
The site is on my local machine for now, or I’d give a link.
I’m pretty sure the problem is that WordPress doesn’t know that the user is getting a 404. At one point I had this string of code in my index.php file:
<?php if (get_page_name() == ‘home’) {
include ‘home_content.php’;
} elseif (get_page_name() != ‘home’) {
include ‘subpage_content.php’;
/*the above is still in my index.php file, below is all that has been changed.*/
} elseif (is_404()) {
include ‘404.php’;
}
?>Any help is appreciated
- The topic ‘WordPress 404.php file is never called’ is closed to new replies.