Comments can be enabled on the archive page by setting the global variable $withcomments
to true
before calling comments_template()
:
global $withcomments;
$withcomments = true;
comments_template( '', true );
As Michael pointed out in a comment on the original post, comments_template()
does not return output when $withcomments
is true
, or in a number of other scenarios:
function comments_template( $file="/comments.php", $separate_comments = false ) {
global $wp_query, $withcomments, $post, $wpdb, $id, $comment,
$user_login, $user_ID, $user_identity, $overridden_cpage;
if ( !(is_single() || is_page() || $withcomments) || empty($post) )
return;
...
comment-reply JS
Normally, you’d want to include the comment-reply
JS where comments are being handled (single posts), but the the built in comment-reply
JS script does not seem to be intended for use on pages with multiple posts, so you’ll need to roll your own solution instead.