If I understand correctly, the <?php wp_list_comments(); ?> in the comments.php should list all the comments right?
Yes
http://codex.wordpress.org/Template_Tags/wp_list_comments
Rather then doing..
<?php require("comments.php"); ?>
You can just use..
<?php comments_template(); ?>
WordPress will call comments.php from your theme as necessary..
http://codex.wordpress.org/Include_Tags#The_Comments_Template
Hello, thanks for all the responses 😀
I tried
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<h2 class="title"><?php the_title(); ?></h2>
<div class="reply" id="reply_content_<?php the_ID(); ?>">
<?php comments_template(); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
And I got nothing 🙁
No comments list, no comment reply box.
All I’m trying to do is just display all the post and their comments in the index. :\
From the area of the page i linked to above.
This tag includes the file comments.php from your current theme’s directory. If that file is not found, it will instead include wp-content/themes/default/comments.php. To display comments on the main index or archive pages, you’ll need to set the $withcomments variable to “1” before calling this tag.
Thanks alot!
Silly me, I was trying all sorts of stuffs like <?php comments_template(1); ?> and etc but I just realized that I can just add $withcomments = 1;!
Thanks alot for the help, really appreciated it 🙂
(@shibonari)
16 years, 9 months ago
Hi there, I have some questions regarding wp_list_comments
This is the code in my index.php:
and I just copied the default comments.php.
If I understand correctly, the <?php wp_list_comments(); ?> in the comments.php should list all the comments right?
I’m sorry if I had mistaken it. Any help on how can I display all the comments and the comment reply box for the post in the index?
Thanks in advance 🙂