WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] My 404 page throws a 500: internal server error (12 posts)

  1. Ahrengot
    Member
    Posted 3 years ago #

    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]

  2. Aaron T. Grogg
    Member
    Posted 3 years ago #

    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?

    thx,
    Atg

  3. Ahrengot
    Member
    Posted 3 years ago #

    @aarontgrogg
    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: http://pastebin.com/hwYH0EmA. 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 http://ahrengot.com/ and here's a non-existing link: http://ahrengot.com/drupal-rocks

    The 404 page is located at http://ahrengot.com/wp-content/themes/ahrengot/404.php

  4. Aaron T. Grogg
    Member
    Posted 3 years ago #

    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 "yahoo.com"...

    Atg

  5. Ahrengot
    Member
    Posted 3 years ago #

    Thanks for being so helpful – However the pastebin link i posted above should work :)

  6. Aaron T. Grogg
    Member
    Posted 3 years ago #

    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?

    Thx,
    Atg

  7. Ahrengot
    Member
    Posted 3 years ago #

    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 :)

  8. Aaron T. Grogg
    Member
    Posted 3 years ago #

    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?

    Atg

  9. Aaron T. Grogg
    Member
    Posted 3 years ago #

    Ahrengot:

    Is this resolved?

    Thx,
    Atg

  10. Ahrengot
    Member
    Posted 3 years ago #

    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!

  11. Aaron T. Grogg
    Member
    Posted 3 years ago #

    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!

    Atg

  12. Ahrengot
    Member
    Posted 3 years ago #

    Thanks buddy :)

    I'm actually thinking about implementing some of the features from Roots and Bones as they both seem very cool :)

Topic Closed

This topic has been closed to new replies.

About this Topic