Free Wordpress Blog Setup

How to Add a Custom Author Profile Page to Your WordPress

By Editorial Staff in Themes
How to Add a Custom Author Profile Page to Your WordPress

When you have a multi-author blog, it is wise to add an author’s profile page to your WordPress blog. An author page bring the readers close to their favorite authors by having some background information listed in their profile. Sadly, most free WordPress themes do not come with a custom author.php which is why this tutorial can be helpful. In this tutorial, we will be showing you how to add a custom author profile page to your WordPress blog.

Because most free themes do not have a custom author.php file, WordPress automatically callback to archive.php or index.php when someone views the author profile page. The problem with that is that it will only list all the posts written by the author, and it provides no personal information about the author.

It is recommended that you copy your archive.php and save it as author.php and then add the codes from the sample below to customize your page matching the theme settings:

<?php get_header(); ?>

<div id="content" class="narrowcolumn">

<!– This sets the $curauth variable –>

<?php
if(isset($_GET['author_name'])) :
$curauth = get_userdatabylogin($author_name);
else :
$curauth = get_userdata(intval($author));
endif;
?>

<h2>About: <?php echo $curauth->nickname; ?></h2>
<dl>
<dt>Website</dt>
<dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd>
<dt>Profile</dt>
<dd><?php echo $curauth->user_description; ?></dd>
</dl>

<h2>Posts by <?php echo $curauth->nickname; ?>:</h2>

<ul>
<!– The Loop –>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
<?php the_title(); ?></a>,
<?php the_time('d M Y'); ?> in <?php the_category('&');?>
</li>

<?php endwhile; else: ?>
<p><?php _e('No posts by this author.'); ?></p>

<?php endif; ?>

<!– End Loop –>

</ul>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

This page above will display: Author’s nickname, their website, background information (whatever you put in the description field), and a list of posts written by this specific author. All of the background detail and information will be handled from the Profile page in the admin panel. There are other plugins that will let you add pictures and other extra features in multi-author blogs.

Now that you have created the custom author profile page, you want to make sure that your single.php, and in some cases your index.php both are pointing to the author’s profile link when the name is mentioned. Often when themes do not provide a custom author page, they tend to link to author’s website URL in the “written by” section of each post. So you should search for words like Written by or something along the same line and replace the codes with this snippet, and if you do not have that code, then you want to add the code below anyways in order to provide your users with a link to author’s profile page.

<p>Written by:
<?php the_author_posts_link(); ?></p>

Another great way of letting your users know about author profiles page is simply by listing all authors from your blog on one page, or in the sidebar. We have written an article about this in the past that provides both a raw code solution and a plugin solution, so check out our article on how to list all authors from your blog in WordPress.

To add more parameters, you should refer to the Official WordPress Codex Author Templates page.

Free Wordpress Blog Setup

Comments

7 Responses to “How to Add a Custom Author Profile Page to Your WordPress”
  1. nice information, thanks for write..

  2. Epic Alex says:

    There is actually a better/newer way of calling the author’s data, using $authordata, which is already defined in WP then something like ->display_name. This saves creating the $curauth variable

  3. Greg says:

    I must say I like seeing the author’s profile below the post. Help you get to know the author.

  4. Excellent tip, I was looking for something like this. Thanks.

  5. Geekyard says:

    Awesome Article :) Now my blog looks cool with separate author page :)

Share Your Opinions

Tell us what you're thinking...
and if you want a pic to show with your comment, then get gravatar!

Please make sure that you have read our Comment Policy.

Due to high volume of request from our readers, we are adding this feature that allows you to stay updated with this post's comments without having to participate in the discussion even though we would love your input as always. Don't worry we hate SPAM just as much as you do, so you will never receive any SPAM messages from our site and that's our promise to you.

Subscribe without commenting

Close Bar