Title: comments_by_type problems
Last modified: August 19, 2016

---

# comments_by_type problems

 *  [bloggus](https://wordpress.org/support/users/bloggus/)
 * (@bloggus)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/comments_by_type-problems/)
 * I’m just playing with a blank theme and if I have
 * > <?php if ( ! empty($comments_by_type[‘comment’]) ) : ?>
 * it gives me no commets to show which it should.
 * If I change it to
 * > <?php if ( empty($comments_by_type[‘comment’]) ) : ?>
 * it shows comments. To be honest i’m confused!

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

 *  [chaz7979](https://wordpress.org/support/users/chaz7979/)
 * (@chaz7979)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/comments_by_type-problems/#post-1345679)
 * Any luck? I am having the same issue.
 *  [Laura Yeffeth](https://wordpress.org/support/users/lyeffeth/)
 * (@lyeffeth)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/comments_by_type-problems/#post-1345681)
 * Try adding the this
    `<?php $comments_by_type = &separate_comments($comments);?
   >` directly before `<?php if ( !empty($comments_by_type['comment']) ) : ?>`
 * This worked for me except I am using
    `<?php if ( !empty($comments_by_type['pings'])):?
   >` instead of `<?php if ( !empty($comments_by_type['comment']) ) : ?>`
 *  [chaz7979](https://wordpress.org/support/users/chaz7979/)
 * (@chaz7979)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/comments_by_type-problems/#post-1345682)
 * That worked for me as well but, I still posted this as I am curious why I would
   need to declare it.
 *  [Marcomail](https://wordpress.org/support/users/marcomail/)
 * (@marcomail)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/comments_by_type-problems/#post-1345704)
 * Why in some blogs
 * `<?php if ( !empty($comments_by_type['comment']) ) : ?>`
 * it work alone, but in other is necessary add before
 *     ```
       <?php $comments_by_type = &separate_comments($comments); ?
       ```
   
 * ??
 *  [Hnrrrch](https://wordpress.org/support/users/hnrrrch/)
 * (@hnrrrch)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/comments_by_type-problems/#post-1345715)
 * Great lyeffeth! it worked for my custom theme 🙂 …i’m using WP 3.0.1
 *  [Wiliam_Syd](https://wordpress.org/support/users/wiliam_syd/)
 * (@wiliam_syd)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/comments_by_type-problems/#post-1345717)
 * Excellent.
 * This fixed comment issues I was having with arjuna-x 1.5.3
 * Thank you again.

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

The topic ‘comments_by_type problems’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 6 participants
 * Last reply from: [Wiliam_Syd](https://wordpress.org/support/users/wiliam_syd/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/comments_by_type-problems/#post-1345717)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
