title: Wordpress wp_head only inserting script when logged as Admin
body: <p>I want to add a simple script using the <code>wp_head</code> action to the head of my Wordpress website. Curiously, the code shows up when I'm logged in as Admin but doesn't show up for regular visitors.</p>
  
  <p>Any idea why?</p>
  
  <p>Here is my code in functions.php:</p>
  
  <pre><code>// Add Yieldlove scripts to wp_head()
  function child_theme_head_script_yieldlove() {
      if(is_home()) {
          echo "&lt;script type='text/javascript'&gt;
          var yieldlove_site_id = 'xxxx';
          &lt;/script&gt;&lt;script type='text/javascript' src='//cdn-a.yieldlove.com/yieldlove-bidder.js'&gt;&lt;/script&gt;
  
          &lt;script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'&gt;&lt;/script&gt;
          &lt;script&gt;
              var googletag = googletag || {};
              googletag.cmd = googletag.cmd || [];
          &lt;/script&gt;";
          } else {
              echo "&lt;script type='text/javascript'&gt;
          var yieldlove_site_id = 'xxx';
          &lt;/script&gt;&lt;script type='text/javascript' src='//cdn-a.yieldlove.com/yieldlove-bidder.js'&gt;&lt;/script&gt;
  
          &lt;script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'&gt;&lt;/script&gt;
          &lt;script&gt;
              var googletag = googletag || {};
              googletag.cmd = googletag.cmd || [];
          &lt;/script&gt;";
      }
  }
  add_action( 'wp_head', 'child_theme_head_script_yieldlove' );
  </code></pre>