Comments on homepage (index.php) are duplicated under posts

I am displaying WP comments on homepage in my index.php file, but the problem I have is that some comments are displayed under each post. The comment number is okay, but the comments are assigned wrong to the post. However when displaying the single page, everything is okay.

I checked the IDs of the comments in the DB and it seems to be okay too.

Read More

Any ideas what’s going on?

I am using the following code in my index.php to display the comments:

<?php global $withcomments; $withcomments = 1; comments_template(); ?>

Here is the whole index.php and if it helps here is the actual page.

See for example the comment on the latest post from “Linda Walker”, it is displayed under each post :-/

P.S. The posts were originally imported from MovableType, I hope it has nothing with that as I used the official import plugin.

Related posts

Leave a Reply

1 comment

  1. Seems I fixed it myself, I had to call

    <?php global $withcomments; $withcomments = 1; comments_template('/comments.php', true); ?>
    

    as I am filtering comments by type:

    <?php wp_list_comments('type=comment&callback=jennygg_comment'); ?>