WordPress Tip: How to add author biography information to your posts

Ed: This article is part of the 21 Days of WordPress Tips

If you’re maintaining a WordPress blog that has multiple authors you may want to let them attach a little biography information to everything they write. Here’s the steps to do this simply.

1. Have your authors login to the WordPress dashboard and click on their name in the top right corner.

author1

2. Then scroll down to the “Biographical Info” textarea under “About Yourself” and fill it in.

author21

Now that they have their bio information in, it’s your job to add it to the bottom of each post. The template tags that we will be using are the_author() and the_author_description(). In this walkthrough we’ll be adding the author information to the single.php template file so it will only show on individual posts, but you can easily use this walkthrough to show it on other areas of your site.

3. Open the single.php file of your theme and find the the_content() function call. We’re going to add the following code directly underneath. We’ll also wrap it in an additional <div> tag with a class of author_bio so we can add a little CSS pizazz later on.

<div class="author_bio">
<strong><?php the_author(); ?></strong>
<p><?php the_author_description(); ?></p>
</div>

author3

Save and upload single.php with the above changes.

At this point, if you check out an individual post you’ll see the author name and bio right underneath the rest of the post content. However, this blends with rest of the content so we’ll want to add some CSS to the stylesheet to set it apart.

4. Open the styles.css file of your theme and add this to the bottom:

.author_bio {
background: #efefef;
padding:5px;
margin:10px 0;
border: double 4px #fff;
}

Obviously you can modify the CSS elements to your liking, but this is the general idea of what you’ll see:

author4

And that’s it. You’re now giving your authors the prestige they deserve. Enjoy!

Comments

comments