• Make Tech Easier
  • Videos
  • Downloads
  • Articles
    • Windows
    • Linux
    • Mac
    • Android
    • Firefox
    • Chrome
    • Web
    • Google
    • WordPress
    • All Categories
  • Search

Add an Author Information Box to Your WordPress Theme

Soumen Halder 24th Mar 2010 WordPress 21 Comments
  • 7
    Facebook 1 Twitter 6
    Google Plus 0 Pinterest 0
    Stumbleupon 0 Reddit 0
    Pocket Instapaper
  • Next
  • Prev
Add an Author Information Box to Your WordPress Theme

Do you have multiple authors writing articles in your WordPress blog? If yes, then it would be a good idea to add an author box in your blog’s theme rather than adding the author byline manually in each and every single article. WordPress allows so many customizations that you can quickly code a simple author box for your blog’s theme.

Before we go further, let’s have a look at some examples:

1. Smashing Magazine Author Box

This is how the author box looks in the popular design blog Smashing Magazine. The byline of an article shows the name of the author, profile image, description, blog URL and a link to author’s Twitter account.

The author box at Smashing Magazine Website

2. ProBlogDesign Author Box

The author box at Problogdesign looks very impressive. The author Gravatar and description is shown in the left column while the right column shows social bookmarking buttons.

problogdesign author box

Create An Author Box For your Blog’s Theme

1. First, get all the authors to update their author profile from the “Profile link” provided within the WordPress administration area. The author should fill out the first name, last name and add a custom bio in the description field. It’s also recommended to add the link of Author’s website in the corresponding field as shown below:

edit author profile in WordPress

These are the basic parameters which we will display in the author byline section. We will add the other parameters later (if required.)

2. To show the author box, open your single.php file and create a unique HTML div within which the author box will be enclosed. For example

<div class="authorbox">
 
</div>

This div is created so that we can add CSS rules and style the section accordingly. You can place this code where you want the author byline to display.

3. Now you need to decide what are the elements which you want to show in the author byline section. Some of the parameters and their respective codes are given below:

1. Author’s First Name :

If you want to display only the first name of the author, use

<?php the_author_meta('user_firstname'); ?>

2. Author’s Last name:

To display the author’s last name, use

<?php the_author_meta('user_lastname'); ?>

3. Show both the first name and the last name:

It’s easy to combine both the above codes and display the full name of the author. To display the full name, use

<?php the_author_meta('user_firstname'); ?> <?php the_author_meta('user_lastname'); ?>

4. Show Author Name with a Link to his Website:

You can show the author’s full name and at the same time link the name to the author’s website. Use

<?php the_author_posts_link(); ?>

5. Author Description:

To show the description of the author bio, use

<?php the_author_meta('description'); ?>

6. Display Author’s Website Link:

To display the Author’s website URL, use

<?php the_author_meta('user_url'); ?>

All of the above codes can be customized to suit your style. You can further enclose the above codes within HTML tags as shown below:

Show Author's URL

7. Author Gravatar:

To display the author’s Gravatar use

<?php echo get_avatar( get_the_author_meta('user_email'), '80', '' ); ?>

The number “80″ used in the above code stands for the size of the image. You can customize it further which depends on how big or how small you want the avatar to be displayed.

Visit Author's Gravatar

I think you are getting the idea how to customize the codes, which entirely depends on how you want the section to look like.

8. Author’s email address:

To display the author’s email address, use

<?php the_author_meta('user_email'); ?>

9. Link to Twitter account:

This one is a bit tricky, because WordPress does not have any field for displaying the URL of Twitter profile by default. However, there is a smart workaround which can be used to show any custom link or text as provided by the author.

Ask the authors of your blog to add the link of their Twitter account in the AIM field under “Profiles” in WordPress administration area.

Add Twitter account

Now go back to single.php file and insert

<?php the_author_meta('aim'); ?>

to display the Twitter profile link. Again, it totally depends on how you customize the look and output. Here is an example code:

display Twitter link of the author

Style The Author Section using CSS

Once the coding job is over, it’s time to beautify the section and align the items properly. Here is an example css code

<div class="authorbox">
 
    <div class="left">
        //contains the gravatar
    </div>
 
    <div class="right">
        //rest of the code
    </div>
 
</div>   //author box ends

The above structure can be illustrated by the following diagram

Styling Author Box with CSS

In the above CSS structure, we are creating three div tags. The Outer div tag will contain the two inner div tags which are named as “left” and “right” respectively. The “Left” div will contain the author gravatar while the right div will contain the author’s name, bio and Twitter profile link. We will align the “left” div to left and the “right” div to right. Here is the entire code and CSS which you need to use

Code

Include the following code in your single.php file where you want the author info section to appear:

<div class="authorbox">
    <div class="left">
        <?php echo  get_avatar( get_the_author_email(), '80' ); ?>
    </div>
 
    <div  class="right">
        <p><strong>Written by <?php  the_author_posts_link(); ?></strong></p>
        <p><br><?php  the_author_description(); ?></p><br>
        <p><a  href="<?php the_author_meta(‘aim’); ?>">Follow me on  Twitter</a></p>
    </div>
</div>

CSS

Include the following code in the CSS stylesheet

.authorbox{width:590px;height:140px;background:#CCC;font-family:verdana;font-size:13px;background-color:#FAFAFA;border:1px solid #F0F0F0;}
.left{float:left;width:100px;height:100px;margin:25px;}
.right{float:left;margin-top:25px;width:425px;}

Note: It’s advisable to change the class names by comparing with existing classes of your theme to avoid conflict.

And here is the output of the above codes

author box code and output

That concludes the tutorial. Have you created an author Info section in your WordPress theme? Let’s hear your thoughts and ideas in the comments section.

Do you like what you read here?

Receive the latest update in your inbox.

Similar Articles

Best Plugins to Automatically Watermark Images In WordPress
Giveaway of The Week: 5 Premium ThemeFuse Themes (Update: Contest Closed)
How to Color Code Your WordPress Posts Page

21 Comments

  • Rish

    Amazing! Was searching for something like this for weeks!

    25th March 2010 04:55:54 Reply

  • Soumen Halder

    @Rish: Glad you found it useful. Thanks for the comment.

    25th March 2010 10:35:42 Reply

  • TechSexy

    When you are using Thesis theme, the best SEO wordpress theme now, it is very easy to do that.

    26th March 2010 07:50:17 Reply

  • SpiritSentient

    Pure, rockin', goodness. I see these author boxes *everywhere*, and I'm so glad you shared how to integrate them with my theme. It's awesome that it's built into some themes, and it's awesome if there are plugins, but this full control code-integrated technique was perfect for me. Thanks!

    12th May 2010 04:29:07 Reply

  • Soumen

    Thank you SpiritSentient. As you can see, it's not that hard to create a customized author information box in WordPress

    14th May 2010 06:27:26 Reply

  • SpiritSentient

    Yeah man! I created one very similar to yours on SpiritSentient immediately after reading your tutorial! So helpful :) (I'll look into customizing it more later :D)

    Thanks again man!

    14th May 2010 02:30:29 Reply

  • Giast

    very very thanks!

    22nd May 2010 11:43:23 Reply

  • TechGyo

    I tried shortcode for Twitter link. But it didn't work

    1st July 2010 09:28:28 Reply

  • Jobs Forestry

    Thanks for sharing such meaningful information…
    Regards..

    Jobs Forestry

    16th August 2010 06:37:01 Reply

  • Calin

    Excellent tutorial! Well written and easy to implement due to your step-by-step description!

    Thanks for sharing!

    24th August 2010 07:49:23 Reply

  • jobs forestry

    Thanks for sharing such a wonderful and meaningful information…
    Regards..

    Jobs Forestry

    26th August 2010 01:03:45 Reply

  • Dene Brock

    Thanks! After changing themes I realized I had lost my “About The Author” info. With your help, I was able to add that content back and retain my new theme.

    19th September 2010 12:51:00 Reply

    • Soumen

      @Dene: Glad you liked the information here. Thanks for the comment.

      19th September 2010 01:03:00 Reply

  • Carabusu

    Hi,

    What WP plugin are you using in order to see that Expand profile for above user who commented the article?

    Thanks

    22nd February 2011 11:36:00 Reply

    • Damien Oh

      If you are referring to the comment system, we are using Disqus on this blog. All this profile expanding/collapsing feature is part of the Disqus commenting system.

      25th February 2011 02:38:00 Reply

  • cakeandsushi

    Thanks a lot for this, worked out great for me!! The only thing I found that had to be modified was the height that you added to I removed the height and add overflow:hidden so that no matter how much text is added the height will automatically adjust. What do you think of this method? Thanks again for a wonderful tutorial!!!

    30th April 2011 09:28:00 Reply

  • Hassan Mehmood

    Thanks Alot Dude =)
    You save my day Man!! This tutorial has everything regarding to what I was looking for
    Cheers

    25th May 2011 10:52:00 Reply

  • Pradeep

    Hi Soumen Halder, first of all I am really happy to find your post which is related to my blogs’ present need. However, I couldn’t found appropriate options in my blog to apply your instructions! So I am requesting you to please help me find out the way. Before I describe my problem you should know that I am not looking for multiple authors profiles on my blog but just only my profile and also I don’t have knowledge on codes! Anyways, here goes my issue:

    1) As you said in the first point, when I tried to fill the form I have found that the form is already set in the correct state. ie:
    Username
    Usernames cannot be changed.

    First Name

    Last Name

    Nickname (required)

    Display name publicly as

    admin
    Pradeep

    The ‘Bio’ and Website details were also filled. Then I had tried following your instructions from second point.

    2) Here, I had clicked the ‘Editor’ link under ‘Appearance’ Tab-> Single Post (single.php)->placed the code()given in your second point below this code ie found in the file. Then I inserted rest of the urcodes that are described in your third point below to the div class=”authorbox. 3)Clicked on update file and checked all my dashboard as well as viewe my blogbut found no changes! Well, now here started the mess! I really don’t know if I am doing it in a proper way or not! All this may sound stupid/weird to you but I sincerely needyour assistance in this aspect please!! FYI: http://www.realwebmarket.com/blog is my blog. You can reply to my mail idpdeepu84@gmail.com to further direct contacting.Look forward your help…ThanksPradeep.

    8th June 2011 11:42:00 Reply

  • The Nerdy Nurse

    Thanks for the turtorial! I used it a few others to make our author box for http://www.MyRealityTech.com

    I still don’t think I’m 100% happy with it, but I HATE playing with code and decided it was good enough for the time being.

    11th July 2011 06:03:00 Reply

  • Azukah

    Thanks for the tutorial, Soumen. It was exactly what I was looking for.

    16th September 2011 03:36:00 Reply

  • HavefunForever

    Can you tell the codes for showing author Username and “Display name”?

    13th November 2011 01:38:00 Reply

  • About
  • Contact Us
  • Advertise
  • Privacy Policy
  • RSS Feed Terms

© 2007 - 2013 Make Tech Easier. All rights reserved.



Receive Daily Update in your Inbox

Quick Tips

Resize Window More Efficiently in Mac

When resizing application windows in Mac, there are a few tricks that you can do to make the resizing more efficient.

1. Move your cursor to the edge (side or top) of the window. You should see the cursor change into a double arrow.

2. Click the left mouse key together with any of the modifier key:

  • Option - this will resize the window equally on both side
  • Shift - this will resize the window both vertically and horizontally.
  • Command - this allows you to resize the app window in the background.

Try it out and be more efficient.

Poll
Best Posts
  • MTE Explains: How CRON Can Automate Your Tasks And Make Your Life Easier
  • How to Change The Size and Position Of The Windows 8 Start Screen
  • Reduce Memory Usage And Tab Clutter With OneTab [Google Chrome]
  • Run Your Own Pastebin with Stikked
  • Learn Gmail Shortcuts with the KeyRocket Chrome Extension
  • Adding Dropbox and Google Drive to Microsoft Office 2013
  • Open Applications Without Leaving Firefox
  • How to Manage "Files" in GNOME 3.6
  • How to Color Code Your WordPress Posts Page
  • A Sneak Peek At "Windows Blue". What to Expect For The New Windows 8 Update