user3852799 user3852799 - 1 year ago 72
PHP Question

Head content appears in the body tag (Wordpress)

My head content(metas, scripts etc.) appears in the body tag. I have header php with this code

<!DOCTYPE html>
<html <?php language_attributes(); ?>>

<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device=width">
<title<?php bloginfo('name'); ?></title>
<?php wp_head(); ?>

<header class="header">
<h1 id="logo"><a href="<?php echo home_url(); ?>">|||</a></h1>
<h4 id='title' ><?php the_title(); ?></h4>


and footer.php is closing it with this. `

<?php wp_footer(); ?>

Already tried changing encoding from UTF-8 to UTF-8 without BOM using Notepad++, and still the same ,, this is my website if you wanna see with inspect [website]

website . Any ideas ? :S

Answer Source

Your html is broken:

<title> Name Lastname / Official Website</title>
      ^---- missing >
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download