title: Make a splash screen appear only on first visit in Wordpress
body: <p>I'm trying to make a splash screen appear only the first time someone visits a Wordpress site.
  I don't know much about PHP but setting and reading a cookie seemed like an easy way to do this, so I added this to the <strong>header.php</strong>:</p>
  
  <pre><code>&lt;?php if ( !isset($_COOKIE['accessed']) ) { 
      setcookie('accessed', 'yes', time() + (86400 * 30)); // 30 days
  ?&gt;
      &lt;script&gt;
          // Some code
      &lt;/script&gt;
  &lt;?php 
      } 
  ?&gt;
  </code></pre>
  
  <p>The script runs but the cookie never get's set so it runs on every visit...</p>
  
  <p>I read somewhere that you can't set and read a cookie on the same page with PHP, but if that's true then I really don't know how should I implement this.</p>
  
  <p>Any hint would be really appreciated!</p>