Support » Fixing WordPress » My 404 page throws a 500: internal server error

  • Resolved Ahrengot


    I’m using a modifyed version of the 404 page that ships with The HTML5 Boilerplate. I’ve added my default header, sidebar and footer to that 404 page but unfortunately that destroyed it.

    Shouldn’t get_header(), get_sidebar() and get_footer() work in 404 pages or is this normal? I’m trying to zero in on what area to debug here πŸ™‚

    Anyway here’s the code for my 404 page. It’s pretty simple:

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 11 replies - 1 through 11 (of 11 total)
  • hey, Ahrengot, you have a URL to the site you’re having issues with?

    any code samples you can share? like, your modified version of the 404?


    Thanks for your feedback. I hadn’t seen a moderator removed the source code from my original post. I didn’t know it was against the rules to post larger blocks of code here, so sorry for that πŸ™‚

    Anyway, here’s my 404 page: It uses Google’s FixURL widget, but other than that there’s no voodoo magic going on.

    If i remove the wordpress template tags like get_header() and get_footer() it works perfectly, and i use those exact same template tags on my other pages with no problems.

    My site is and here’s a non-existing link:

    The 404 page is located at

    yeah, definitely comes up as a blank page…

    but i still can’t see the code, so just not sure…

    this comment box seems to allow code:

    Allowed markup: a blockquote code em strong ul ol li.
    Put code in between backticks.

    but you say it removed it from your initial question?

    if so, you’re welcome to send the PHP file as an attachment directly to me at my username, plus the “at”, then a “”…


    Thanks for being so helpful – However the pastebin link i posted above should work πŸ™‚

    Have you tried commenting-out these two PHP lines…
    global $post;
    echo $post->post_title;
    …just to see if that’s the issue?

    Occurs to me that maybe there isn’t a $post and therefore $post->title if it is a 404 page?

    Also, is this issue actually associated with this plug-in, or is this a general HTML5 Boilerplate issue?


    I thought about that too, but removing those doesn’t make any difference. I get a “500 internal server error” as soon as i include the get_header() call.

    What do you mean by plug-in? The reason this post is tagged HTML5 boilerplate is because this 404 page is the one the HTML5 boilerplate uses πŸ™‚

    Reason for asking about plug-in is that I wrote this HTML5 Boilerplate plug-in, which is how I found this topic, and was just wondering if it is related to your using my plug-in, so I could look for larger issue.

    At any rate, yes, get_header(), get_sidebar() and get_footer() should all work fine on any page within your theme. Have you tried commenting them out, one-by-one, to see which is causing the issue?

    What theme are you using, by the way?



    Is this resolved?


    Sorry i didn’t see your reply there, @aarontgrogg πŸ™‚

    For some inexplicable reason it works just fine now. I haven’t changed anything in the code, so something must have needed some time to adjust…

    Anyway, the theme is my own. My first WP theme actually β€”Β And it’s no way near finished yet. I’ve used The HTML5 Boilerplate as a foundation and spiced it up with open graph tags so all my posts share/embed nicely on Facebook, but haven’t used your plugin, although it looks cool πŸ™‚

    Anyway, thanks a lot for the help!

    Nice, glad it’s working now, at the end of the day, that’s all that matters, right?? πŸ™‚

    Cheers, and good luck with your theme!


    Thanks buddy πŸ™‚

    I’m actually thinking about implementing some of the features from Roots and Bones as they both seem very cool πŸ™‚

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘My 404 page throws a 500: internal server error’ is closed to new replies.