title: How to load site resources regardless of parent file's path
body: <p>I'm pretty familiar with WordPress, and a fan of this CMS. So I'm used to the <code>get_header()</code> function that includes the <code>header.php</code> file. But now I'm developing a raw PHP project, and I want a similar ease here too. I designed a folder structure like below:</p>
  
  <pre>
  project/
         css/
              bootstrap.css
         js/
              jquery.js
              project.js
         inner-folder/
              some-page.php
         header.php
         index.php
         footer.php
         style.css
  </pre>
  
  <p>I made a custom function <code>is_page()</code> just like WordPress to load page-specific items. Everything's working just fine where my <code>header.php</code> contains:</p>
  
  <pre><code>&lt;html&gt;
     &lt;head&gt;
        &lt;link rel="stylesheet" href="css/bootstrap.min.css"&gt;
        &lt;link rel="stylesheet" href="style.css"&gt;
     &lt;/head&gt;
  &lt;body&gt;
  ...
  </code></pre>
  
  <p>and my <code>footer.php</code> contains:</p>
  
  <pre><code>      ...
        &lt;script src="js/jquery.js"&gt;&lt;/script&gt;
        &lt;script src="js/project.js"&gt;&lt;/script&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And my <code>index.php</code> contains:</p>
  
  <pre><code>&lt;?php require_once( 'header.php' ); ?&gt;
     ...
  &lt;?php require_once( 'footer.php' ); ?&gt;
  </code></pre>
  
  <p>And everything's working just fine, until...<br>
  I started working on the <code>inner-folder/</code>. In <code>some-page.php</code> I used the same code like the <code>index.php</code> and you can guess, all the CSS and JS file links get broken.</p>
  
  <p>How can I make a function or something so that regarding anywhere of my <code>project</code> folder (within any sub directory or sub-sub directory) I can load any of my resources without any hamper? And it should be performance-savvy too.</p>