• Weird problem – There’s a blank space right at the top of the webpage.
    On inspecting the code through firebug, I notice that all of my code inside the head tag is inside the body tag.

    This is what I am seeing:

    <html>
     <head>
     </head>
     <body>
       "
           "
      meta tags and stylesheets
      the content
     </body>
    </hmtl>

    The site link is: http://swiftanalytics.com

    This happens only in Chrome, on firefox, everything is alright.

    I moved the site from my development server: http://labs.42works.in/swiftanalytics TO http://swiftanalytics.com. When I check the development server on Chrome, the site opens up fine, but the blank space adds only on swiftanalytics.com on Chrome.

    I came across this forum post: http://ww.wp.xz.cn/support/topic/header-appearing-in-body-tag?replies=17
    This is the exact same problem that I am facing. I tried changing the encoding format but to no avail, all my files are already “UTF8 encoded without BOM”.

    Please help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Validating your site (rectify markup errors) can help resolve the problem. Your validation report shows the meta tags at the proper locations – so it does not seem to be a browser issue.

    BTW, do you find the same problem with any of the WordPress default themes?

    Thread Starter anmolrajdev

    (@anmolrajdev)

    Krishna,

    Thanks for replying.

    Its strange because when I am trying to validate the markup at http://labs.42works.in/swiftanalytics, it doesn’t return me any of the errors.

    And no, none of the other default theme has this problem. Infact, I have created a blankstate theme which I’ve used for many websites and it always have worked alright. What’s making me pull my hair is that the same code on http://labs.42works.in/swiftanalytics is working absolutely fine on Chrome, it is the exact same code at http://swiftanalytics.com that is giving me a real hard time.

    One thing that I read in the w3c validator error report was

    Warning 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.

    From the other forum post that i mentioned in the question, I think this is the root cause of the problem. I reopened all my theme files in notepad++ and made sure that all files were encoded without BOM (converted the files to BOM from under Encoding->Convert to UTF-8 without BOM, there were no changes made which meant the files are already in that format). Any ideas on how to fix the BOM encoding issue??

    I don’t think it’s a BOM issue. If the theme in your development site works fine, better delete the theme in your site and replace it with a copy of the theme used in your dev site. Perhaps that will resolve the issue.

    BTW, did you directly modify the blankslate theme or did you use a child theme for your customizations? It’s always better (and the recommended approach) to use child themes for customizations so that you won’t face problems like the current one and you can safely update the theme without losing your modifications.

    As you say that you have been using the same theme without problems, how old is it? Has it been updated?

    Thread Starter anmolrajdev

    (@anmolrajdev)

    I don’t think it’s a BOM issue. If the theme in your development site works fine, better delete the theme in your site and replace it with a copy of the theme used in your dev site. Perhaps that will resolve the issue.
    ————————————–
    Krishna, this is exactly what I’ve done. But not solving the problem.

    BTW, did you directly modify the blankslate theme or did you use a child theme for your customizations? It’s always better (and the recommended approach) to use child themes for customizations so that you won’t face problems like the current one and you can safely update the theme without losing your modifications.

    As you say that you have been using the same theme without problems, how old is it? Has it been updated?
    ————————————–
    My bad. What I meant was that I am start with a blank theme – all the common markup written and stylesheets included but without any style- have used it on many projects, but today is a bad day!

    The development server is a Linux server and the live one is Windows. Could that be a problem?

    Though Linux servers are the best for WordPress hosting, Windows servers are also being used and need not create such problems. As I indicated earlier, your current problem is theme-specific as you may not have the same problem with any other well-coded theme. For instance, download some themes from WordPress repository and try and see if they cause similar issues. If not, you can make sure that it’s only the theme that’s to blame. Try some themes from: http://ww.wp.xz.cn/themes/

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘code in on Chrome/Safari’ is closed to new replies.