Quite often it is required to show little information about the author , beneath the post written by him/her. One of the many advantages of showing author info is that it helps in building a network, as the readers of the blog tend to connect more with the author in such a way. So heres how its done .
Inserting Author Info
First of all locate “_authorinfo.php” or “authorinfo.php” in your theme files. If you have one then use the following code :-
<?php include(THEME_LIB.’/_authorinfo.php’);?> or
<?php include(THEME_LIB.’/authorinfo.php’);?>
The above code will simply display “Author Info”, anywhere you put this code.
If you want to display author info in the post then (as is desirable in most of the cases), you will need to use conditional PHP statement, something like this :-
<?php if(is_single()):?><?php include(THEME_LIB.’/_authorinfo.php’);?><?php endif;?>or<?php if(is_single()):?><?php include(THEME_LIB.’/authorinfo.php’);?><?php endif;?>
Customizing Author Info Box
To customize Author Info box, locate file “_authorinfo.php” or “authorinfo.php”, in your theme files. Following codes will help you in the process of customization.
To call name of the author use :-
<? php the_author(); ?>
To call URL of the author (in case the author is a guest), use :-
<? php the_author_url(); ?>
For number of posts by the author, use :-
<? php the_author_posts(); ?>