WordPress offers users the option to add additional information to their profile like, first name, website and biographical info.
To display the full author information of a specific post, WordPress uses the the_author_meta template tag. This tag also offers the ability to specify the information about the author you like to retrieve. In this case we’re looking at the description / biographical info of the author.
By default WordPress will display the full author description when the php tag, <?php the_author_meta( ‘description’ ); ?>, is used inside your WordPress Theme.
So far so good, but now I would like to show some summarized information (include description) about the author at the bottom of the single post page. And on the author page itself I would like to display the full description and other available information. The situation above can’t be created without some custom coding…. and we’ve got some nice code right here!!
Post update 04/17/2013
Array count replaced by WordPress “wp_trim_words” function .
Making efficient use of WP functionality http://codex.wordpress.org/Function_Reference/wp_trim_words.
Added “strip_tags” functionality to remove HTML from WP user bio description.
Author Excerpt Function
Copy paste the author excerpt function to the functions.php file inside your theme directory.
'.$more_txt.' '.$authorName.''); return $authorDescriptionShort; } ?>
What does the code do?
- Limit the number of words used for the author description.
- Display dots where the word limit cuts off the description
- Display a read more link pointing to the WordPress author page.
Author excerpt Template tag
Copy paste the author excerpt template tag to the single.php file inside your theme directory.
This function is specifically written to display an intro of the author description. To display other information about the author you can use the default WordPress author meta tags