how to show author information on each wordpress post

show author information on each wordpress post is really good habit in wordpress post. So reader will know information writer who is writing the article. Many people like this information and they really read the information about author.

how to show author information on each wordpress post

how to show author information on each wordpress post
how to show author information on each wordpress post

For showing the author information you need put following code in the functions.php file show after your post content the author information will displayed to reader.


function get_author_bio($content=''){
global $post;

$post_author_name=get_the_author_meta("display_name");
$post_author_description=get_the_author_meta("description");
$html="</pre>
<div id="about_author" class="clearfix">\n";
$html.="<img class="avatar" src="http://www.gravatar.com/avatar.php?gravatar_id=&quot;.md5(get_the_author_email()). &quot;&default=&quot;.urlencode($GLOBALS[" alt="PG" width="80" height="80" />\n";
$html.="
<div class="author_text">\n";
$html.="
<h4>Author: ".$post_author_name."</h4>
\n";
$html.= $post_author_description."\n";
$html.="</div>
</div>
<pre>
\n";
$html.="</pre>
<div class="clear"></div>
<pre>
\n";
$content .= $html;

return $content;
}

add_filter('the_content', 'get_author_bio');

Just put the above code in functions.php file. You dont need to do code in single.php file.