[resolved] Weird Widget behaviour on 404 page (9 posts)

  1. Nazgul
    Posted 9 years ago #

    I just installed the Widgets plugin on my blog and everything works, except for one small issue.

    If you take a look at my site nazgul.nu/blog/, you'll see an item called Categoriën. And if you go to a category, a post, a page, whatever, it stays like that.
    Except when its a 404 page. If you look at nazgul.nu/blog/idonotexist/, you'll see that it's changed to Categoriën.
    It's the same widget, so what could be causing this?

  2. Nazgul
    Posted 9 years ago #


  3. Nazgul
    Posted 9 years ago #

    It appears nobody here knows what's wrong?

    Can you guys at least point me to a place where they might know?

  4. Well, that is damned odd, isn't it? Is this the standard categories widget?

    It appears to be an encoding problem somehow. Firefox tells me that your normal blog page is UTF-8, but that the 404 page is ISO-8859-1 (right click the page and select View Page Info, look at the Encoding: on the General Tab).

    I don't know where that gets set, exactly.

  5. Nazgul
    Posted 9 years ago #

    Yes, it's the default categories widget.

  6. Wait, what is this in your header?
    <meta http-equiv="Content-Type" content="UTF-8" />

    That ain't right. It should be more like this:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    What you have there now will probably cause Firefox to guess at the character encoding, and of course, it's not a good guesser all the time.

    Look in your theme's header.php file and see what is there. It should be this instead of whatever it is now:

    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

  7. Nazgul
    Posted 9 years ago #

    I fixed the Content-Type issue (which is apparently a bug in the Blix theme?), but the problem still persists.

  8. I checked the headers being returned by your server. It appears that the actual http header for Content-Type is sending iso-8859-1 and the meta tag isn't overriding that for whatever reason. I don't have a solution, yet, but it's something to look at.

  9. Nazgul
    Posted 9 years ago #

    Thank you very much!!!

    It appears that PHP always sends a Content-Type header, which is configurable in the php.ini, but defaults to iso-8859-1.

    I can't change my php.ini, because there are other sites running on that server that may break by the change, but I've fixed it by adding this line to the top op my theme header.php
    <?php header('Content-Type: text/html; charset=utf-8'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic