Show Attachments on Author Page
-
Hello,
I want to show the user/author’s comments on his/her author page. I would like to show the attachments added by ‘comment attachments’.
Doe anybody know how to get the attachments on a non-comments page (like in the WP Admin comments section?)
This is the function I use for showing comments on the author page (author.php)
<?php $author_id = get_the_author_meta( 'user_id' ); $args = array( 'author_id' => $author_id, 'number' => '10' ); $comments = get_comments($args); foreach($comments as $comment) : echo('<li class="comment">' . $comment->comment_content),'<h5><a href='.get_permalink($comment->comment_post_ID).'>', get_the_title($comment->comment_post_ID), '</a></h5>', '<time><em>' . $comment->get_comment_date . '</em></time>', '</li>'; endforeach;?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Show Attachments on Author Page’ is closed to new replies.