In functions.php
I enqueue comment-reply and also define a callback function for use with wp_list_comments()
:
function theme_queue_js(){
if (
! is_admin()
&& is_singular()
&& comments_open()
&& get_option('thread_comments')
)
wp_enqueue_script( 'comment-reply' );
}
add_action('wp_print_scripts', 'theme_queue_js');
function simple_comment_format($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<?php if ( $comment->comment_approved == '1'): ?>
<li <?php comment_class(); ?>>
<article>
<time><?php comment_date(); ?></time>
<h4><?php comment_author(); ?></h4>
<?php comment_text(); ?>
<?php comment_reply_link(); ?>
</article>
<?php endif;
}
And in comments.php
I’ve kept things pretty minimal:
<section id="comment-form">
<?php comment_form() ?>
</section>
<?php if ( have_comments() ): ?>
<section class="commentlist">
<h2>Comments!</h2>
<ul>
<?php
wp_list_comments(
'type=comment&max_depth=5&callback=simple_comment_format'
);
?>
</ul>
</section>
<?php endif; ?>
Everything is working ok except that the comment reply links are not showing up for any of the comments.
The documentation on modifying comments in general seems really bad!
Thanks for any help