Return to Snippet

Revision: 60370
at November 6, 2012 05:35 by adambundy


Initial Code
function wpse19316_author_comments( $length )
{
    $final_length = (int) $length;
    $author_comments = get_comments( array( 'ID' => $GLOBALS['authordata']->ID ) );
    foreach ( $author_comments as $comment )
    {
        $comment_length = sublen( $comment->comment_content );
        $comment_excerpt = $comment->comment_content;
        if ( $comment_length > $final_length )
            $comment_excerpt = substr( $comment->comment_content, $final_length );
        echo $comment_excerpt.'<br />';
    }
}

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

Initial Description
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:

wpse19316_author_comments( 100 );

Initial Title
Wordpress - list author comments on Author page

Initial Tags
wordpress

Initial Language
PHP