Posted By

adambundy on 11/06/12


Tagged

wordpress author


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

adambundy


Wordpress - list author comments on Author page


 / Published in: PHP
 

URL: http://wordpress.stackexchange.com/questions/19316/recent-comments-on-author-page

Thanks to @kaiser on WP answers for this.

Place this function in your functions.php file, then use it in your template with the function call like:

wpse19316authorcomments( 100 );

  1. function wpse19316_author_comments( $length )
  2. {
  3. $final_length = (int) $length;
  4. $author_comments = get_comments( array( 'ID' => $GLOBALS['authordata']->ID ) );
  5. foreach ( $author_comments as $comment )
  6. {
  7. $comment_length = sublen( $comment->comment_content );
  8. $comment_excerpt = $comment->comment_content;
  9. if ( $comment_length > $final_length )
  10. $comment_excerpt = substr( $comment->comment_content, $final_length );
  11. echo $comment_excerpt.'<br />';
  12. }
  13. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: killjim01 on October 18, 2014

red bottom heels oakley sunglasses wholesale chi flat iron,chi hair strighteners toms wedges michael kors sale marc jacobs,marc jacobs handbags,marc jacobs bags,marc jacobs outlet moncler jackets christian louboutin,christian louboutin shoes,christian louboutin outlet fitflop coach outlet stores ugg shoes,uggs for cheap,uggs outlet,uggs for kids,ugg boots sale,uggs sale,uggs on sale,ugg gloves,ugg bailey button,ugg boots cheap,ugg moccasins,uggs canada,uggs for women,fake uggs,ugg boots,ugg uk,ugg boots on sale coach factory outlet coach cyber monday 2014,coach cyber monday,cyber monday 2014,cyber monday deals,cyber monday sales,cyber monday,louis vuitton cyber monday 2014,louis vuitton cyber monday,michael kors cyber monday 2014,michael kors cyber monday

You need to login to post a comment.