WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Header appearing in body tag (17 posts)

  1. ElSebas
    Member
    Posted 3 years ago #

    Im having a problem with my code, all the info that should be in the header tag in the body tag here is my code:

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

    Any ideas why this is happening??

  2. design_dolphin
    Member
    Posted 3 years ago #

    Can you please post the code in a pastebin?

  3. ElSebas
    Member
    Posted 3 years ago #

    Sorry didn't know that here is the url:

    http://wordpress.pastebin.com/JGtnBtw3

  4. ElSebas
    Member
    Posted 3 years ago #

    Also don't know why but after the body tag and before the content I see some space in firebug and in Chrome show me some quotes like:

    <html>
     <head>
     </head>
     <body>
       "
           "
      meta tags and stylesheets
      the content
     </body>
    </hmtl>
  5. design_dolphin
    Member
    Posted 3 years ago #

    Hmmm

    Can you try removing this part:

    #
    <!--[if lt IE 9]>
    #
                    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    #
                    <![endif]-->
    #
                    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
    #
    
    #
                    <title><?php wp_title('',true,'right'); ?><?php bloginfo('name'); ?></title>
    #
                    <?php if( is_singular() ) wp_enqueue_script( 'comment_reply' ); ?>

    And see if that makes a difference?

    Might be an error in the included code somewhere. If it does make a difference add each line back one by one to see when it happens. Is 'html' a legal doctype? Otherwise try this for example, see if that helps:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    That is all that I can see that can be causing the problem, but I could be overlooking something.

  6. ElSebas
    Member
    Posted 3 years ago #

    No didn't make a difference. Here is are some screenshots of the code

    http://www.flickr.com/photos/57553101@N06/

  7. ElSebas
    Member
    Posted 3 years ago #

    Fixed

  8. cvatca
    Member
    Posted 3 years ago #

    How did you fixed? i have the same problem.

  9. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    @cvatca, you'd be best starting your own topic.... old topics with multiple posts don't get further attention

  10. maritin
    Member
    Posted 3 years ago #

    Hi ElSebas, i'm having the same issue. Can you give me your solution to check if it is work in my case?
    Thanks

  11. 123milliseconds
    Member
    Posted 3 years ago #

    Please mark thread as resolved so that

    - others with similar problem can see it as resolved and will read this thread for help if they have similar problem

    - people providing help see it as resolved and will not waste time reading this post.

  12. robertjakobson
    Member
    Posted 3 years ago #

    ElSebas, how on earth did you fix the problem?

  13. oysterboy
    Member
    Posted 3 years ago #

    Same with me. what was the solution?

    - As well, I deleted all script includes,, temporarily disabled wp_head(),
    temporarily disabled all plugins, but to no effect.

  14. maritin
    Member
    Posted 3 years ago #

    Hi ElSebas, would be fine if you can share the solutions with us so another people can fix the issue too.
    I fixed but not sure if the solution is the yours, i made a new clean theme and add the all things from the basic theme.
    For me adding bodyclass function to the body tag fix the issue, very strange but this works for me.
    Thanks
    Best,

    Mario

  15. Peter
    Member
    Posted 2 years ago #

    I had this same strange problem and what's worse is that in firebug and chrome inspector they both show the <head> content within the <body> tags....but when viewing the source the <head> content is in the correct place.

    Basically after rebuilding my theme bit by bit I found my functions.php and two of the files it was including were UTF8 encoded and by changing their encoding to UTF8-without-bom sorted this issue..

    I think that is the solution ElSebas found.
    Baffled me for half a day trying to work that out....

    I wonder if this is an UTF8 issue with some browser inspectors?

    In the end just another test to add to the build scripts to be sure that all files are in the correct format :)

  16. Adam
    Member
    Posted 2 years ago #

    Hi All,

    Confirmation of Peter's solution: I had changed my header.php file to UTF-8 (for Chinese text) and that caused this issue.

    I changed it to sans BOM and all back to normal.

    Wondering though, does this just affect browser inspection tools (noticied on Chrome and Firebug) and why?

    A

  17. edwinvaldez
    Member
    Posted 2 years ago #

    I've used the same solution in Notepad++. I've changed in "Encoding Menu" the UTF-8 to UTF-8 without BOM encoding and the problem is out.

    This solutions appears too in: http://wordpress.org/support/topic/head-scriptslinks-showing-up-inside-body-tag

Topic Closed

This topic has been closed to new replies.

About this Topic