Hi,
I've been having a problem getting comments_template to work when calling it in a function in theme functions using AJAX. It works fine when it is called for the first page load, but not when called during AJAX. I'm thinking that there's some include that's missing, but I don't know enough here to understand what.
Here's the essence of the function code that's in my functions.php file for my Theme. (the entire thing much longer)
function displayLargePost ($postid) {
// get the submitted postid parameter if set.
if (!$postid) {
$postid = $_REQUEST['postID'];
}
$myposts = new WP_Query();
$myposts->query( 'p='.$postid );
while( $myposts->have_posts() ) : $myposts->the_post();
// some formatting stuff is done then output post content
the_content();
// some more formatting then output the comments template (doesn't work with AJAX)
comments_template();
}
Again, the function executes when the AJAX call is run, everything works except for the comments_template outputs '0'.
Thanks for any help!