Does anybody have a clue how to make AJAX Comment Loading working with Genesis Framework?
The great Genesis-Framework Support (Andrea) helped me out to find the issue:
Change this:
public function ajax_handler() {
global $post, $id, $cpage;
query_posts( array( 'p' => $_REQUEST['postid'] ) );
if ( have_posts() ) {
set_query_var( 'cpage', intval( $_REQUEST['cpage'] ) );
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_REFERER'];
the_post();
comments_template();
exit();
}
exit( 0 );
}
to this in the plugin file:
public function ajax_handler() {
global $post, $id, $cpage;
query_posts( array( 'p' => $_REQUEST['postid'] ) );
if ( have_posts() ) {
set_query_var( 'cpage', intval( $_REQUEST['cpage'] ) );
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_REFERER'];
the_post();
comments_template('',true); //this line
exit();
}
exit( 0 );
}
It would be great if this enhancement find it’s way into the next update for this plugin.