title: Include php file in Wordpress' functions.php not working for header.php
body: <p>I have included the line below in my <code>functions.php</code> file (at the top, also tried that line at the bottom of the code). I can access variables and all other stuff defined in that file in <strong>all templates</strong>. But when I try to <code>echo $something</code> from that file within the <strong>header.php</strong>, nothing shows up. No content, no error message.</p>
  
  <pre><code>require_once '/path/to/file.php';
  </code></pre>
  
  <p>Ok, after lots of trying I just found out that using the line from above inside the <strong>functions.php</strong> with </p>
  
  <pre><code>global $something;  
  echo $somtehing;
  </code></pre>
  
  <p>in the <strong>header.php</strong> shows the value inside the wordpress header. <code>global $something</code> is not needed in template files though. Can please anyone explain me why?</p>
  
  <p><a href="https://secure.php.net/manual/en/reserved.variables.globals.php" rel="nofollow noreferrer">https://secure.php.net/manual/en/reserved.variables.globals.php</a></p>
  
  <p>Thanks!</p>