Support » Fixing WordPress » theme header php

  • hi. i have install a code from google on my header, then i deleted it, but something going wrong. can you help me?? how to fix it??? my header now in editor…

    <head>
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- marketing -->
    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-3526791549033206"
         data-ad-slot="4428464488"
         data-ad-format="auto"></ins>
    <script>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    	<meta name="viewport" content="width=device-width">
    	<title><?php wp_title( '|', true, 'right' ); ?></title>
    	<link rel="profile" href="http://gmpg.org/xfn/11">
    	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    	<!--[if lt IE 9]>
    	<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
    	<![endif]-->
    	<?php wp_head(); ?>
    </head>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Max

    (@clementsm)

    You have an open <script> tag before the line “<meta charset="<?php bloginfo( 'charset' ); ?>">“, that is not closed.

    I believe your code should look as follows:

    <head>
    	<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    	<!-- marketing -->
    	<ins class="adsbygoogle"
    		style="display:block"
    		data-ad-client="ca-pub-3526791549033206"
    		data-ad-slot="4428464488"
    		data-ad-format="auto"></ins>
    	<script>
    		(adsbygoogle = window.adsbygoogle || []).push({});
    	</script>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    	<meta name="viewport" content="width=device-width">
    	<title><?php wp_title( '|', true, 'right' ); ?></title>
    	<link rel="profile" href="http://gmpg.org/xfn/11">
    	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    	<!--[if lt IE 9]>
    	<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
    	<![endif]-->
    	<?php wp_head(); ?>
    </head>

    ie., you are missing two lines:

    (adsbygoogle = window.adsbygoogle || []).push({});
    	</script>
    Thread Starter johnygt

    (@johnygt)

    Thank you very much Max for your help. You are Awesome!! Have a nice day!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘theme header php’ is closed to new replies.