There is no template tag for recent comment, but there is a Widget. Of course you could look at wp-includes/widgets.php to see how it ‘gets done’.
There’s also plugins that will handle recent comments.
See Plugins/Archive
Thanks very much,
Was looking at:
And it seems to be: http://www.semiologic.com/software/widgets/recent-comments/
<?php the_recent_comments(); ?>
Thanks,
WizzKid
Thought I had it, but didnt 🙁 I will look into it more!
You can’t use that tag on its own. You have to install the plugin to go with it, and then it works.
I have my own ‘hack’ for this… although I don’t know which puts less load on the server:
<?php
$query1 = "
SELECT wp_comments.comment_ID, wp_comments.comment_author, wp_comments.comment_post_ID, wp_posts.post_title FROM wp_comments, wp_posts
WHERE wp_comments.comment_post_ID = wp_posts.ID AND wp_comments.comment_approved = '1'
ORDER BY wp_comments.comment_date_gmt DESC LIMIT 15";
$result1 = mysql_query($query1);
while ($r1 = mysql_fetch_array($result1)) {
extract($r1);
echo "$comment_author on <i>$post_title</i>
";
}
mysql_free_result($result1);
?>