Title: wp_list_comments and listing comments
Last modified: August 19, 2016

---

# wp_list_comments and listing comments

 *  Resolved [shibonari](https://wordpress.org/support/users/shibonari/)
 * (@shibonari)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/wp_list_comments-2/)
 * Hi there, I have some questions regarding wp_list_comments
 * This is the code in my index.php:
 *     ```
       <?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 require("comments.php"); ?>
       </div> 
   
       <?php endwhile; ?>
       <?php endif; ?>
       ```
   
 * 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 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/wp_list_comments-2/#post-1185784)
 * > 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](http://codex.wordpress.org/Template_Tags/wp_list_comments)
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/wp_list_comments-2/#post-1185801)
 * 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](http://codex.wordpress.org/Include_Tags#The_Comments_Template)
 *  Thread Starter [shibonari](https://wordpress.org/support/users/shibonari/)
 * (@shibonari)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/wp_list_comments-2/#post-1185887)
 * 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.:\
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/wp_list_comments-2/#post-1185904)
 * 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.**
 *  Thread Starter [shibonari](https://wordpress.org/support/users/shibonari/)
 * (@shibonari)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/wp_list_comments-2/#post-1185910)
 * 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 🙂
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/wp_list_comments-2/#post-1185914)
 * No problem… 😉

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘wp_list_comments and listing comments’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)

 * 6 replies
 * 3 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/wp_list_comments-2/#post-1185914)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
