WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Weird Widget behaviour on 404 page

[Resolved] Weird Widget behaviour on 404 page

  • 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?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Anybody?

    It appears nobody here knows what’s wrong?

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

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    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.

    Yes, it’s the default categories widget.

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    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'); ?>" />

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

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    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.

    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'); ?>

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Weird Widget behaviour on 404 page’ is closed to new replies.