Posted By

theriddlebrothers on 02/16/11


Tagged

wordpress comments trackbacks pingbacks


Versions (?)

WordPress: Get Comment Count Without Pingbacks/Trackbacks


 / Published in: PHP
 

URL: http://www.luscarpa.com/snippets/wordpress/comments-number-without-pingbacks-and-trackbacks/

Snippet from http://www.luscarpa.com/

  1. function comment_count( $count ) {
  2. if ( ! is_admin() ) {
  3. global $id;
  4. $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
  5. return count($comments_by_type['comment']);
  6. } else {
  7. return $count;
  8. }
  9. }
  10. add_filter('get_comments_number', 'comment_count', 0);

Report this snippet  

You need to login to post a comment.