Support » Alpha/Beta/RC » wp2.7 BUG on – wp_list_comments()

  • Resolved Rami Yushuvaev


    WP2.7 BUG?

    i have a post with 1 comment and one pingback.

    using <?php wp_list_comments(); ?> i see both of them and <?php comments_number(); ?> returns – “2 Responses“.

    but when i use <?php wp_list_comments('type=comment'); ?> i see only the comment whitout the pingback, but the <?php comments_number(); ?>` it still returning “2 Responses“.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    That’s not a bug, just not an obvious piece of functionality. Notice that it says “responses”? A pingback or trackback is a type of response. It’s also considered to be a type of comment, just one left on some other blog.

    To do this sort of thing correctly:

    1. In your actual templates, where you call the “comments_template” function, change it to this:
    The “true” part forces it to pre-separate the comments into types. This takes extra time, so you only want to do it when you know you’re going to be separating them out anyway in the comments.php.

    2. To display the comments number, do this sort of thing:

    global $wp_query;
    echo count($wp_query->comments_by_type['pings']);
    echo count($wp_query->comments_by_type['comment']);
    echo count($wp_query->comments_by_type['pingback']);
    echo count($wp_query->comments_by_type['trackback']);

    You can use any of those echo’s to display the count for just that one type.

    This is a bug, because it also affects the pagination of the comments.

    If I separate comments and pings, and apply pagination (two things you can do with WP 2.7), the pagination will still consider comments+pings, producing always one or two empty pages at the end.

    I’m using 2.8.2 and I’m getting the opposite.

    I’ve got a comment and a trackback and it only says one response.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp2.7 BUG on – wp_list_comments()’ is closed to new replies.