Adding post count
-
Hi all,
Im using this code:
<?php $comments = get_comments('status=approve&number=5'); foreach($comments as $comment) :?> <?php $my_id = $comment->comment_post_ID ; $post_id_comms = get_post($my_id); $title = $post_id_comms->post_title;?> Who: <?php echo($comment->comment_author);?><br /> About: <a href="<?php echo get_permalink($my_id) ?>#comment-<?php echo $comment->comment_post_ID?>" title="on <?php echo $title ?>"><?php echo $title ?></a><br /> What they said: <?php echo($comment->comment_content);?><br /> When they said it: <?php echo($comment->comment_date);?><br /> <?php endforeach;?>
to output the most recent comments on a homepage but am struggling to find the correct code that also outputs the comment count for each post with a recent comment. All I have managed to do so far is zero for all comments.
Any ideas?
Many thanks.
Ash
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Adding post count’ is closed to new replies.