WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] head scripts/links showing up inside body tag (4 posts)

  1. dguyen
    Member
    Posted 3 years ago #

    Here's the dilemma. I have a mysterious padding between the top of the body and the top of my #wrapper. Everything looks fine w/ the source code (in correct flow order). Using Firebug, I notice my stylesheet link, jQuery script, EditURI, WLWmanifest show up inside the <body> tags (-which Firebug says these links are 0x14px in size, presumably the gap I'm referring to.)

    Here's the background:
    When creating my page.php file(included below) I have no issues with the mysterious padding or misplaced links and scripts... but when I decide to cut up the top half and bottom half placing them accordingly into header.php and footer.php (#mainand above and end of #main div and below) whilst making my calls get_header and get_footer -is where my problem occurs...

    Unfortunately I've got this on a local build... but can someone help shed some light?

    [Code moderated as per the Forum Rules. Please use the pastebin]

  2. dguyen
    Member
    Posted 3 years ago #

    I decided to copy and paste my code work into a new text document and for some reason everything is fine. Maybe there was an issue with my original document... ASCII, UTF-8, etc...?

  3. MiKapa
    Member
    Posted 3 years ago #

    Just made an account to say THANKS for the tip of copy paste... I had the same problems, padding on the top, misplaced links and scripts, no validation... horrible! All because of some %^$^%#^%&$ characters (i put the blame on notepad++ which i used for a while...)

    thanx again!

  4. matthewv789
    Member
    Posted 2 years ago #

    I have had this problem on a couple of sites (one Joomla, one just running PHP).

    It turns out it was the specific encoding of the files: I needed to change them from UTF-8 to "UTF-8 without BOM" (BOM="byte-order-mark") in Notepad++ to fix.

    Until I stumbled across that, I was tearing my hair out: exactly as you described, extra space at the top (all browsers), inspect element in either Firefox or Chrome showed scripts etc. included in the body, not head, even though "View source" showed them all in their proper locations. VERY weird.

Topic Closed

This topic has been closed to new replies.

About this Topic