title: Using WordPress Functions in Externally Loaded PHP File
body: <p>I am using AJAX to load an external PHP file into my page (to improve page load). In the external PHP file though I have various Advanced Custom Field functions. When I try to load the file, I get the following error:</p>
  
  <pre><code>Fatal error: Call to undefined function get_field() in /path/to/file/wp-content/themes/theme-name/product-tabs/color.php on line 4
  </code></pre>
  
  <p>How can I make it so this external PHP file can run WordPress and Advanced Custom Field functions?</p>
  
  <p>Here's a snippet of the external code:</p>
  
  <pre><code>  if( in_array( 'excolor', get_field('hide_sub') ) ) {
    echo '&lt;li class="active"&gt;&lt;a href="#exterior" role="tab" data-toggle="tab"&gt;Exterior&lt;/a&gt;&lt;/li&gt;';
    }
  </code></pre>