Genesis Theme – 404.php changed now not working.
-
Ok, I wanted the 404.php to not show the pages, because it showed even private pages. So I removed the code that showed the pages and left it only showing the posts.
saved it in the wordpress editor and then checked and it worked.
it worked just fine.
Then I thought, Hmm, I want to be notified via email of dead pages.
So I opened the editor back up for the 404.php page.and after
function genesis_404() {
I added this code:$adminemail = get_option('admin_email'); $website = get_bloginfo('url'); $websitename = get_bloginfo('name'); if (!isset($_SERVER['HTTP_REFERER'])) { $failuremess = "A user tried to go to $website" .$_SERVER['REQUEST_URI']." and received a 404 (page not found) error. "; $failuremess .= "They did not come from a link on somewhere. They came from IP: ".$_ENV['REMOTE_ADDR']; mail($adminemail, "Site error??? url they tried to load: ".$_SERVER['REQUEST_URI'], $failuremess, "From: $websitename <$adminemail>"); } elseif (isset($_SERVER['HTTP_REFERER'])) { $failuremess = "A user tried to go to $website" .$_SERVER['REQUEST_URI']." and received a 404 (page not found) error. "; $failuremess .= "It wasn't their fault, so try fixing it. They came from ".$_SERVER['HTTP_REFERER']; mail($adminemail, "Bad Link To ".$_SERVER['REQUEST_URI'], $failuremess, "From: $websitename <$adminemail>"); }Then saved it.
loaded a page I know does not exist and now it is just white page, nothing loads.So I re-opened up the 404.php in the editor and just cut out the code above that I added. I left it the way it was before, saved it, and it still does not work.
I still get a white page, no content.
Can someone tell me how I broke it? I put the code back the way it was and it is broke.Thanks you.
Richard
The topic ‘Genesis Theme – 404.php changed now not working.’ is closed to new replies.