Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Add a Custom Author Profile Page to Your WordPress

Last updated on by
Elegant 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.


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Nafees says:

    How can i display author post title, short excerpt and post image on author,php page

    Thankyou
    Nafees

  2. HariprasadSushamaHari says:

    Hi,

    I am a novice to wordpress n I dint fully understand the steps here…I mean I’ve already got an author page in the template…So am I supposed to replace its original code with this one??And I cant find the file ‘single.php’…I ve installed a plugin to show user avatar in the frontend..How will I link it to the user profile page….Please heip me out here…

  3. nathanbunn says:

    Thanks! Not entirely what I wanted, but no matter, I can modify it to my own needs :)

    I will play with it anyway, but is it possible to include bbPress posts into the page, now that bbPress is a plugin for WordPress and is fully integrated into the system? I’ll play anyway, but just a thought.

  4. md.ikhtiar says:

    yah, nice tips

    thanks brother for share it.

  5. Deadrawk says:

    So, im interested in doing this, first of all, where do you go to edit this? Under your themes? or somewhere else?

  6. Julien de Gasquet says:

    Is there a way to display more than 10 posts?

    • Editorial Staff says:

      Yes, but that would change the number of posts displayed in all of your archives. Go to Settings > Reading and change the number there.

      • Julien de Gasquet says:

        Ok I get it :) Thx for the fast answer. What I really wanted to do was add some pagination in order to be able to browse all the posts. I figured it out.

  7. Renato Alves says:

    I was looking for something like that. Thanks Wpbeginner! It’ll be very helpfull.

  8. Geekyard says:

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

  9. Dario Gutierrez says:

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

  10. Greg says:

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

  11. 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

  12. joyoge bookmark says:

    nice information, thanks for write..

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.