Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter elanaspantry

    (@elanaspantry)

    No one knows the answer to this?

    wp_guy

    (@wp_guy)

    It’s a little complicated, but can be done.

    You have to add this bit of code to the ‘functions.php’ file of your theme: (preferably at the end, before the ‘?>’)

    add_filter('get_comments_number', 'comment_count', 0);
    function comment_count( $count ) {
    	global $id;
    	$comments = get_approved_comments($id);
    	$comment_count = 0;
    	foreach($comments as $comment){
    		if($comment->comment_type == ""){
    			$comment_count++;
    		}
    	}
    	return $comment_count;
    }

    If the functions.php file doesn’t exist, create it.

    Thread Starter elanaspantry

    (@elanaspantry)

    thx for your reply wp_guy…

    i created a file called functions.php, inserted the code above and uploaded it to my themes directory.

    no luck though. it still counts the pingbacks:

    http://www.elanaspantry.com/desserts/chocolate-orange-truffles/

    this is what the code looks like for displaying comments on single.php:
    comments_number('0 comments','1 comment','% comments');
    and comments.php:
    comments_number('no comments', '1 comment', '% comments' );

    any thoughts?

    Thread Starter elanaspantry

    (@elanaspantry)

    i did forget to mention that i was using the Separate Comments & Pings Plugin – this seems to be confusing WP.

    i disabled that and of course the numbers are correct now – but the pingback shows up in the comments (which is what we don’t want)

    thanks again…

    wp_guy

    (@wp_guy)

    Weird, because that plugin is supposed to adjust the comments number.

    Could it be that you are using an older version of the plugin?

    Thread Starter elanaspantry

    (@elanaspantry)

    nope – using version 1.0 (the current version)

    i disabled the plugin for now…

    Thread Starter elanaspantry

    (@elanaspantry)

    OK – i decided to search for a better plugin with support: http://wordpress.org/extend/plugins/comment-sorter/.

    I installed it, set it up and it appears to work fine. Thanks for your efforts again wp_guy.

    @wp_guy: It worked like a charm. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How do I NOT count number of trackbacks/pingbacks with comments_number?’ is closed to new replies.