title: Wordpress: Fatal error: Call to undefined function is_user_logged_in()
body: <p>I'm loading a PHP script in a wordpress page but when the script is run I get this:</p>
  
  <pre><code>Fatal error: Call to undefined function is_user_logged_in()
  </code></pre>
  
  <p>Code that it tries to run:</p>
  
  <pre><code>&lt;?php
  if ( is_user_logged_in() == true ) {
    /* Some code */
  } else {
   /* Some other code */
  }
  ?&gt;
  </code></pre>
  
  <p>I tried searching for an answer but I couldn't find a working solution.<BR>
  From what I found on the internet my script is running outside of wordpress and that's why it can't find the function.</p>