I have seen a few threads about this but have not seen any solutions that have worked for me so far.
My wordpress site (www.strantech.com) appears to be showing code at the top left on every page that definitely should not be there. I am assuming there is a spacing issue that I cannot spot as a novice coder.
From what the other boards suggested, it seems to be related to an issue in the header.
I have pasted my header below for your convenience.
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<meta HTTP-EQUIV="Pragma" content="no-cache">
<meta HTTP-EQUIV="Expires" content="-0">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<!-- Favicon -->
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri(); ?>/css/lightbox.css" />
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri(); ?>/css/QapTcha.jquery.css" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
<script>
window.themePath = '<?php echo get_template_directory_uri(); ?>';
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41041086-1', 'auto');
ga('send', 'pageview');
</script>
</head>
Can anyone provide advice on what the issue might be and how to fix it? Thanks in advance.
Cheers, Jake
Be sure to paste the snippet immediately after the opening
<body>
tag in your Wordpress template. It may look something like this:So immediately after that is where you paste your snippet.
It's not in the header. It right after that where the
<body>
tag is:Remove everything to the right of
<!-- End Google Tag Manager -->