Solved with:
<?php
$args = array(
'user_id' => $user->ID,
'number' => 10, // how many comments to retrieve
'status' => 'approve'
);
$comments = get_comments( $args );
if ( $comments )
{
$output.= "<ul>\n";
foreach ( $comments as $c )
{
$output.= '<li>';
$output.= '<a href="'.get_comment_link( $c->comment_ID ).'">';
$output.= get_the_title($c->comment_post_ID);
$output.= '</a>, Posted on: '. mysql2date('m/d/Y', $c->comment_date, $translate);
$output.= "</li>\n";
}
$output.= '</ul>';
echo $output;
} else { echo "No comments made";} ?>
(@1bjk903)
10 years, 11 months ago
Hi all,
I have author pages for each author and I want to see all of their comments (or all of their recent comments) if I click on their nickname. How can I do this? I tried the beneath code, but that does not show the unique comments per user… It just outputs all recent comments from everyone combined, but I don’t want that.