How To Display Author Profiles with Thesis Theme

by Nate Devore · 4 comments

Author Profiles. You’ve probably seen them after an article while reading your favorite blog. They are boxes below the post content that give the Author’s Name and Bio. It’s a good idea to have one especially if you have multiple authors. You can place links, RSS feeds, and other details within the box too.

Because Thesis (affiliate link) uses a very good hook system you can easily add any content after the post box as you want. You can add RSS Feed links reminding the readers to subscribe. Let’s get started:

Example:

Here is an example from my other blog onebiginternet.

author_profile

The Code:

You could simple place this code into your custom_functions.php file, change the rss feed link to your own, and be done. But if you want to understand what each section of the codes does, read further.

function post_author_box() {
if (is_single())
{ ?>
<div class="postauthor">
<?php echo get_avatar( get_the_author_id() , 100 ); ?>
<h4>Article by <a href="<?php the_author_meta('user_url'); ?>">
<?php the_author_firstname(); ?> <?php the_author_lastname(); ?></a></h4>
<p><?php the_author_description(); ?></p>
<p class="hlight"><?php the_author_firstname(); ?> has written <span><?php the_author_posts(); ?></span> awesome articles.</p>
<p>Enjoy this article? Subscribe to our <a href="http://feeds.feedburner.com/onebiginternet">RSS Feed</a> to keep up with the latest trends for Designers, Developers and Bloggers!  </p>
</div>
<?php }
}
add_action('thesis_hook_after_post_box', 'post_author_box');

Lets Break this down.

We are going to use custom_functions.php. You could copy and paste this code and place it in the after_post_box hook using Thesis Hooks Plugin but I like to use custom_functions.php for more flexibility.

1. This is going to make sure our author profile will display only on single post pages. We are also naming our function.

function post_author_box() {
if (is_single())
{ ?>


2. Starting our div class.

<div class="postauthor">

3. The code below will display the authors gravatar from gravatar.com

<?php echo get_avatar( get_the_author_id() , 100 ); ?>

4. The code below will display the authors first and last name while providing a link to their website. The author must have the website URL in their user profile in WP Admin.

<h4>Article by <a href="<?php the_author_meta('user_url'); ?>">
<?php the_author_firstname(); ?> <?php the_author_lastname(); ?></a></h4>
<p><?php the_author_description(); ?></p>

5. This displays the number of articles the author has written.

<p class="hlight"><?php the_author_firstname(); ?> has written <span><?php the_author_posts(); ?></span> awesome articles.</p>

6. Here we end the div and also include a way for readers to subscribe.

<p>Enjoy this article? Subscribe to our <a href="http://feeds.feedburner.com/onebiginternet">RSS Feed</a> to keep up with the latest trends for Designers, Developers and Bloggers!  </p>
</div>

7. This completes the function and places the box below the post_box.

<?php }
}
add_action('thesis_hook_after_post_box', 'post_author_box');

That’s it!

You just created an author profile box using Thesis.

Please leave comments below if you found this useful. I would be glad to help you out and clarify any issues you have.

Feel free to share this with your friends too! Re-tweet’s and FB Like’s are sexy.

Nate is a 24-year-old Internet Marketer & WordPress Guru who helps businesses and individuals understand how to market online with The Social Web. Find Nate on Google Plus

Subscribe to Nate's RSS feed or contact Nate Devore.

Leave a Comment

{ 3 comments… read them below or add one }

Adam Helweh April 30, 2011 at 9:03 PM

By any chance do you know how to just get the author specific RSS feeds out of Thesis?

Anonymous April 30, 2011 at 10:50 PM

Great question Adam. Try this, http://www.sitename.com/author/username/feed/

replace sitename with your domain and username with the user of the author you want the RSS feed for. Let me know if this works?

dlb8685 February 11, 2012 at 11:26 AM

Thanks for this. Works great on my site.

Leave a Comment

{ 1 trackback }

Previous post:

Next post: