I was having a problem with a page not calling the onload function in a body tag. After some investigation, I’ve simplified the issue to see that when I include wp-blog-header.php, it creates multiple tags and removes the onload attribute. Here’s a sample of the over-simplification.

The following php script:

<?php require( '../../wp-blog-header.php' ); ?>
<body class="a">
Hello World
</body>

Generates the following HTML in the browser:

<html>
  <head>
  </head>
  <body>
    <body>
      Hello World
    </body>
  </body>
</html>

Further, if I Remove wp-log-header.php and use only this as my php script:

<body class="a">
Hello World
</body>

It correctly outputs the following HTML in the browser:

<html>
  <head>
  </head>
  <body class="a">
    Hello World
  </body>
</html>

What gives? I just did a clean update of WordPress (4.1) and haven’t messed with any system files.

Read more here: Including wp-blog-header.php creates multiple <body> tags


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: