Resetting Pingback Counter?
-
I was having some trouble with my comment count not displaying correctly after using the Hide Trackbacks plugin. After disabling the plugin, I found this code to add to functions.php:
<?php add_filter('get_comments_number', 'comment_count', 0); function comment_count( $count ) { if ( ! is_admin() ) { global $id; $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id)); return count($comments_by_type['comment']); } else { return $count; } } ?>
Now my comments show correctly except my ping count is not reflected in the comment count. Removing this function does not fix the ping count.
The problem here is that I am using a code in my loop.php to display the comment count for a post IF the post has comments. So what happens is some posts have no comments but do have pings, so the comment bubble appears but it reads zero, no matter how many pings.
Does anyone know how to either reset the ping counter function back to default to fix this, or a code I can put in the loop that will display comment count ONLY IF the post has comments (and not just pingbacks)?
Any help is greatly appreciated.
- The topic ‘Resetting Pingback Counter?’ is closed to new replies.