Title: Comment Count
Last modified: August 19, 2016

---

# Comment Count

 *  Resolved [chanel](https://wordpress.org/support/users/chanel/)
 * (@chanel)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/comment-count-5/)
 * I would like to have the amount of comments a page has when it’s being shown 
   as a list. For example:
 * Like you see here with my archives list:
    [http://diaryofchanel.com/archives/](http://diaryofchanel.com/archives/)
   _where it says “Blog Post – (23 cmnts)”_
 * I would like do that for a Page that has a SUBPAGE list.
 * I’ve been trying to find a solution to this for more than 2 weeks.

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

 *  [Jupitercow](https://wordpress.org/support/users/jcow/)
 * (@jcow)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/comment-count-5/#post-1010532)
 * I don’t fully understand what you are trying to do. You want to show how many
   subpages a page has? or how many comments it has?
 * How are you listing the pages currently?
 *  Thread Starter [chanel](https://wordpress.org/support/users/chanel/)
 * (@chanel)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/comment-count-5/#post-1010534)
 * [http://diaryofchanel.com/discuss](http://diaryofchanel.com/discuss) is the page
   I am referring to.
    That particular page has subpages. So far I only have 2 listed
   like this
 * > 1. domestic violence
   >  2. abortion
 * Ideally, i would like to show on my Discuss page, how many comments each SUBPAGE/
   TOPIC has. ie:
 * > 1. domestic violence (18 comments)
   >  2. abortion (32 comments)
 * Here is how I have the Discuss page coded, with it’s own template:
 * > <?php
   >  /* Template Name: Discussions */ ?>
   > <?php get_header(); ?>
   > <div id=”side-left”>
   >  <div id=”content”>
   >  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
   >  <div class
   > =”kutu”> <div class=”ust”><span></span></div>
   >  <div class=”post” id=”post-<?php the_ID(); ?>”>
   >  <h2 class=”pagetitle”><?php
   > the_title(); ?></h2> This section is an open forum for viewers to discuss &
   > debate random topics per week. I will be posting _“The Topic Of The Week”_ 
   > as it will allow us to converse about highlights of the media, politics, celebrity
   > gossip, life & relationships, and parenting. Topics are posted in a numerical
   > order (the highest number being the most recent topic) For those that are subscribed,
   > you will receive an email notification when the new topic is posted! So if 
   > you’re interested in being involved, please [subscribe to my mailing list](http://diaryofchanel.com/subscribe/).
   > Thank you.
   >  <div class=”entrytext”>
   >  <?php if($post->post_parent) $children = wp_list_pages(“
   > title_li=&child_of=”.$post->post_parent.”&echo=0″); else $children = wp_list_pages(“
   > title_li=&child_of=”.$post->ID.”&echo=0″); if ($children) { ?>
   >  -  <?php echo $children; ?>
   >  <?php } ?>
   >  </div>
   >  </div>
   >  <?php endwhile; endif; ?> <?php edit_post_link(‘Edit this entry.’,‘
   > <p style=”margin:10px;”>’, ‘</p>’); ?> <br class=”clear” /> <div class=”alt”
   > ><span></span></div></div> </div>
   > </div>
   >  <?php get_sidebar(); ?>
   > <?php get_footer(); ?>
 *  [Jupitercow](https://wordpress.org/support/users/jcow/)
 * (@jcow)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/comment-count-5/#post-1010540)
 * Try this:
 *     ```
       <div class="entrytext">
       				<?php $children = get_pages('child_of='.$post->ID);
       				if ($children) : ?>
       				<ul>
       				<?php foreach ($children as $post) : setup_postdata($post); ?>
       					<li class="page_item page-item-<?php echo $post->ID; ?>"><a href="<?php echo get_permalink($post->ID); ?>" title="<?php echo get_the_title($post->ID); ?>"><?php echo get_the_title($post->ID); ?></a> (<?php comments_number('0', '1', '%' ); ?> comments)</li>
       				<?php endforeach; ?>
       				</ul>
       				<?php endif; ?>
       			</div>
       ```
   
 * [I tested it and it worked for me](http://labs.jcow.com/plugins/).
 *  Thread Starter [chanel](https://wordpress.org/support/users/chanel/)
 * (@chanel)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/comment-count-5/#post-1010541)
 * It worked wonderfully **jcow**!! Thank you so much for the help. I’ve tried using
   the comment loop before, but I didn’t know how to place it right. I see all I
   was missing was ( ) all along.
 * Excellent.

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

The topic ‘Comment Count’ is closed to new replies.

## Tags

 * [page lists](https://wordpress.org/support/topic-tag/page-lists/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [chanel](https://wordpress.org/support/users/chanel/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/comment-count-5/#post-1010541)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
