title: I want to run wp_query on a separate php file for an ajax call
body: <p>For example:</p>
  
  <pre><code>&lt;?php $numposts = $_POST['showposts']; ?&gt;
  
  
  &lt;?php $home_query_bottom = new WP_Query("cat=&amp;showposts=$num_posts&amp;offset=5"); $b = 0; ?&gt;
  &lt;ul class="thumbs"&gt;
      &lt;?php while ($home_query_bottom-&gt;have_posts()) : $home_query_bottom-&gt;the_post();
          $do_not_duplicate = $post-&gt;ID; $b++; ?&gt;
  
          &lt;li class="post-&lt;?php the_ID(); ?&gt; thumb"&gt;&lt;?php get_the_image( array( 'custom_key' =&gt; array( 'thumbnail' ), 'default_size' =&gt; 'thumbnail', 'width' =&gt; '160', 'height' =&gt; '160' ) ); ?&gt;&lt;/li&gt;
      &lt;?php endwhile; wp_reset_query(); $b = 0; ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>The code above is on its own php file ready to be called by the main wordpress page, however I get an error saying wp_query class not found. I'm assuming it's because I am not using the header.html which probably has a bunch of includes. What do I need for that page to utilize the wp_query class?</p>