• Resolved browncoat

    (@browncoat)


    I have been doing some small mods to a wp theme and I have a whitespace that somehow fiddles its way in between the opening <body> and the next tag that is a div.
    I have tried override the stylesheet with a styletag in the body specifying margin:0 and padding:0 with no success ??

    I have noticed one very strange thing however!
    if I open the bugging page in firefox and view the source – ctrl+a and paste all code in notepad++ there shows up a question mark before the doctype tag that neither shows up in the source view or if I would paste the code into windows notepad.

    this whitespace error (and hidden question mark) does only appear on the startpage. On the other page “test” all works fine.

    Here’s a link to the page.
    https://corvette.redliners.se/
    Sorry there is a quite heavy background at the moment.

    I would very much appreciate some help with this!

    Cheers,
    Marcus.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The editing the theme’s header.php and removing everything between <body> and <div> plus any blank lines before the DOCTYPE.

    Thread Starter browncoat

    (@browncoat)

    Hi, thanks.
    I have no blank lines before the doctype, not between body and the div either. Futhermore I used notepad++’s function “trim trailing space” on the file.

    Have you checked your theme’s functions.php file? Or wp-config.php?

    Thread Starter browncoat

    (@browncoat)

    the theme doesn’t have a functions.php, but I did spot a error in the wp-config.php. I had written “UTF8” instead of “UTF-8” but changing it didn’t do anything that I can see.

    Well, one of your install files has a leading “blank” line that contains a non-standard character, by the sounds of it.

    Thread Starter browncoat

    (@browncoat)

    Interestingly if I write some plain text right after the body tag the text comes “dead top” on the page inside the whitespace.

    Check that you don’t have an “invisible” non-standard character after <body> in header.php

    Thread Starter browncoat

    (@browncoat)

    Ok, with that in mind, even a reinstall would create the same problem then. wp has two million files it it… chanses of spotting the blank line? ??

    Thread Starter browncoat

    (@browncoat)

    what do you mean with “invisible”, there’s no space or character between the tags, I even put the tags on the same line next to eachother now.

    i just noticed that by removing the font property in the css file the whitespace grows somewhat (5px perhaps…)
    prop. looks like: font: normal 0.8em sans-serif,Arial;

    edit: font property for the BODY that is

    even the validator sees that invisible character there:

    https://validator.w3.org/check?uri=http%3A%2F%2Fcorvette.redliners.se%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

    if it is only on the front page, it might be coming from index.php

    Thread Starter browncoat

    (@browncoat)

    Thanks!
    I converted the header.php to “utf-8 without BOM” and it now works!
    So aparently there was some sort of char there, but i SWEAR it didn’t show up in the code. Not in my code app anyway.

    Big thanks to both of you!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Whitespace after opening body tag – going crazy!’ is closed to new replies.