Since WordPress started becoming more popular as a content management system, more people are asking questions how to make it behave and display information like a simple content management system would. A question I was asked recently was if it’s possible to make the author’s page display information. The answer, absolutely. Here’s some code you can use. Put them where you want the information to appear in your author.php file in your theme, inside the loop.
1 2 3 4 5 6 7 8 9 | <div id="authimg"> <?php echo get_avatar( get_the_author_email(), '80', '' ); ?> </div> <div id="authdetails"> <h2><?php the_author(); ?></h2> <p><?php the_author(); ?>'s Web Site: <a href="<?php the_author_url(); ?>"><?php the_author_url(); ?></a></p> <?php the_author_description(); ?> <p>Below, you'll find all posts made by <?php the_author(); ?></p> </div> |
The above will pull an image from Gravatar.com if the author has an image linked to their email address there. It’ll also pull the web site information and description from the web site and bio fields in their account/profile.
After that, don’t forget to style it. Here’s what I use to style the information that would put the author’s image on the left, bio, links and other stuff on the right.
1 2 3 4 5 | /* Author Archive */ #authimg { width: 85px; float: left; } |
Incidentally, this and other useful methods like it is fully detailed in lesson 58 of Blog Evangelists which includes Blog Theme Bootcamp. It’ll show you step by step how to create your own themes and some advanced theme customization methods.