• Resolved ElSebas

    (@elsebas)


    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??

Viewing 15 replies - 1 through 15 (of 16 total)
  • Anonymous User

    (@anonymized-473288)

    Can you please post the code in a pastebin?

    Thread Starter ElSebas

    (@elsebas)

    Sorry didn’t know that here is the url:

    https://wordpress.pastebin.com/JGtnBtw3

    Thread Starter ElSebas

    (@elsebas)

    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>
    Anonymous User

    (@anonymized-473288)

    Hmmm

    Can you try removing this part:

    #
    <!--[if lt IE 9]>
    #
                    <script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    #
                    <![endif]-->
    #
                    <script src="https://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" "https://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.

    Thread Starter ElSebas

    (@elsebas)

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

    codigo3

    Thread Starter ElSebas

    (@elsebas)

    Fixed

    cvatca

    (@cvatca)

    How did you fixed? i have the same problem.

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

    maritin

    (@maritin)

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

    Alwyn Botha

    (@123milliseconds)

    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.

    Robert

    (@robertjakobson)

    ElSebas, how on earth did you fix the problem?

    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.

    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

    Peter

    (@flannerypeterntlworldcom)

    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 ??

    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

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Header appearing in body tag’ is closed to new replies.