Return to Snippet

Revision: 41305
at February 16, 2011 01:23 by theriddlebrothers


Initial Code
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;
	}
}
add_filter('get_comments_number', 'comment_count', 0);

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

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

Initial Title
WordPress: Get Comment Count Without Pingbacks/Trackbacks

Initial Tags
wordpress

Initial Language
PHP