• Resolved JossNL

    (@jossnl)


    I’m having the weirdest problem with WordPress… For a client I’m making a website including a catalog which I made using custom post types.

    Everything went great and WordPress has been positively surprising me along the way with how easy it is to create templates and plugins for it.

    Anyway, on to the problem. I’m using Firefox and I’ve never noticed anything weird. Until I tried the website in IE8 this morning. All the normal pages, posts, categories look just fine, but when I visit the custom post type pages things go crazy in IE8. Alignment is gone, widths are changed etc.

    So I started to try and figure out what the hell was going wrong, and after a whole lot of “Nope… that’s not it”s, I found something. When I deleted the single-showroom.php (for single products) and taxonomy.php (for the taxonomies) files from my theme, the problem was gone. Of course, now I didn’t have the proper styling I wanted for these pages, so this is not a solution I can live with.

    I decided to check the coding on those pages, but they validated and there was nothing I could find… until I copied the whole source code to notepad. When I try to save this source code to a html file, notepad warns me with

    This file contains characters in Unicode format, which will be lost…..

    I noticed that the first part of my declaring was using a different kind of font(size) IN NOTEPAD, weirdest thing, never seen that. To be precise, this part was looking weird:
    ??<!DOCTYPE html PUBLIC "-//W
    and the rest looks ok
    3C//DTD XHTML 1.1//EN" "https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    This is a screenshot of how it looks in notepad when I copy it straight from the source code.
    https://img801.imageshack.us/img801/4077/doctype.jpg

    NOTE: These template files use the same get_header() as all the other files. It’s just that this unicode thing pops up in the custom post type pages, not any of the other single/page/archive etc.

    When I save the file anyway and open it using IE8, the problem is still there. In Firefox, there is no problem. When I delete the doctype declaration and type it back in myself, save it and view it with IE8, there is no problem anymore.

    Does anyone have any idea where this problem is coming from? Unfortunately, I can’t show the site at the moment, as it’s in development behind closed door, so I hope I’ve provided all the information you need.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter JossNL

    (@jossnl)

    Did some more testing by removing the doctype from the header.php file… I know now it’s not a doctype problem, because the problem now jumped to the next line where the first 25 characters look as weird as you can see in the screenshot above.

    Edit:
    Maybe any of these two warning/error ring a bell with someone.

    Byte-Order Mark found in UTF-8 File.
    The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported.

    Validation Output: 1 Error
    Line 1, Column 1: character “?” not allowed in prolog
    ??<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3…

    The validation error only occures on single-..php and taxonomy.php files, even when I only put the get_header() in it. The BOM warning appears on every page.

    Thread Starter JossNL

    (@jossnl)

    Should have done this earlier…

    It appears that somehow this ghostcharacter got in to my template files. Don’t know how, don’t know when. Decided to just copy it to a blank file, make it save with UTF-8, copy it back, save it and upload it. Things are working fine again.

    Shame it took me 5 hours to understand ??

    Hi Joss

    I’m having the same problems. Which files did you find the ghost character in and how did you spot it?

    My problem only started a few days ago, and I have checked all the recently updated files and found nothing

    Many thanks

    Paul

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Weird problem on custom post types IE8’ is closed to new replies.