I'm making an Ajax-heavy theme, where one of the calls is to update the blog display. In an effort to clean things up, I'm trying to move my loop into a different file that I can call directly.
I include that file in the original loading of the page:
<div id="maincontent">
<?php include(TEMPLATEPATH . '/blog.php'); ?>
</div>
but when I call the file directly in my XMLHttpRequest to update the display, it tells me that it can't find the function have_posts(). What else do I need to include to correct this?