• I’m hosted on GoDaddy- I installed WP myself, not through them- and I’m trying to use the theme’s custom 404 page instead of GoDaddy’s. When I try to load 404.php in the browser, however, I get the following error:

    Fatal error: Call to undefined function get_header() in /home/content/70/8739970/html/404.php on line 9

    Anyone know how to fix this?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi there, have you made any edits to the theme?

    Could you please try uploading a fresh, untouched copy of 404.php to your server and see how it goes? I’ve tested it and it’s working fine on my end.

    Just to be clear, the 404.php template file should remain in the Forever theme folder within wp-content/themes – don’t move it out.

    Thread Starter Juni

    (@eleven-pm)

    I installed the theme through my dashboard, so I don’t have the files on my computer, but I only edited the footer and the css (and that was just for fonts and colors); everything else’s been untouched. I haven’t moved the 404 file anywhere. When I try loading the page directly, I get this error instead:

    Fatal error: Call to undefined function stream_context_set_default() in /home/content/70/8739970/html/wp-content/themes/forever/404.php on line 4

    This is the direct link, by the way:

    http://thelittleseawitch.net/wp-content/themes/forever/404.php

    Could you please try uploading via FTP a fresh copy of 404.php into your forever theme folder on your server?

    I searched for the function stream_context_set_default() in the entire Forever theme and could find no references to it, so I’m not sure where that reference is coming from on your install.

    Let me know how it goes.

    Thread Starter Juni

    (@eleven-pm)

    I did; I’m now getting the original error on the page (the link from my last post.)

    Fatal error: Call to undefined function get_header() in /home/content/70/8739970/html/wp-content/themes/forever/404.php on line 9

    (Sorry to be a bother about this! I just don’t know enough php to fix it myself.)

    Hi there, what version of WordPress are you running?

    To rule out a theme-specific issue, have you tried switching to a default theme like Twenty Thirteen or Twenty Fourteen. Does the problem remain?

    Thread Starter Juni

    (@eleven-pm)

    I’m running 3.8.

    I get a different error with Twenty Fourteen. I’ve opened a support ticket with GoDaddy, as it’s still routing 404 errors to their default page- maybe once they’ve fixed that I’ll have a better idea what to do next.

    Thanks for the update. If you’re getting errors with default themes too it may very well be a hosting configuration issue. Let me know what GoDaddy says, and good luck!

    Thread Starter Juni

    (@eleven-pm)

    GoDaddy has gotten back to me: they fixed the issue where it was loading their 404 instead of the 404 in the WP theme. Unfortunately, every theme is giving the same error when I try to load 404.php:

    Fatal error: Call to undefined function apply_filters() in /home/content/70/8739970/html/404.php on line 20

    I’ve tried replacing the 404.php file with the sample from this page with no change. Any thoughts on what I should do next?

    Hi there, if you’re getting the same error in every theme then it could be an issue with your WordPress installation and you might try reinstalling. Since the problem isn’t specific to the Forever theme, if you need further help I suggest you post in one of the general forums, like Troubleshooting, so more people will see it and hopefully chime in with some suggestions.

    Support Forums

    Good luck!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Error on 404.php’ is closed to new replies.