Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

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.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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'); ?> 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.