I have a WordPress site and I’ve set up an author.php
page where a users information is displayed.
Currently I’ve managed to get it to show the authors latest posts they’ve add to the site using query_posts
.
However, I want this page to also show the authors latest comments he has posted on the site, but I can’t seem to figure out how to do it with a query, as I’m not sure if WordPress supports this feature.
There’s a function for this:
get_comments
.Example usage (based on the Codex example):
Important note: avoid using
query_posts
, see: When should you use WP_Query vs query_posts() vs get_posts()?