Posts always show the most recent comment
-
Hi – I’m finding that my posts are only displaying the most recent comment made on any post. For example, if I have a post with 3 comments on it, it will only display the most recent comment made on any post, even if it’s not the same post (see my blog for an example).
My db is fine, and if I change theme the problem’s resolved. It’s therefore a problem with my theme.
I think the problem resides in this bit of
comments.php
:<?php if ($comments) : ?> <h3 id="comments"><?php comments_number('No response', 'One response', '% responses' );?> to “<?php the_title(); ?>”</h3> <?php foreach ($comments as $comment) : ?> <div class="commentmetadata"> <ul> <li><span>Posted: </span><?php comment_date('d-m-y') ?></li> <li><span>Written by: </span><?php comment_author_link() ?></li> </ul> <?php if ($comment->comment_approved == '0') : ?> Your comment is awaiting moderation. <?php endif; ?> </div> <div class="commenttext"> <?php comment_text() ?> </div> <?php /* Changes every other comment to a different class */ if ('alt' == $oddcomment) $oddcomment = ''; else $oddcomment = 'alt'; ?> <?php endforeach; /* end for each comment */ ?>
Any help would be appreciated.
Leon
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Posts always show the most recent comment’ is closed to new replies.