Due to the small number of WordPress blogs that have multiple authors, very few WordPress themes seem to come with a custom author page. This means whenever someone goes to the author page, WordPress will by default use your archives.php file, or if that isn’t available, then use your index.php file. This generally doesn’t make for a very nice author page because it just displays that authors posts in the same format as your archives.
In order to create an author page, you will want to make a copy of your archives.php file and name it author.php, then upload it to your site via FTP. Now go into your theme and edit the author.php page you just created. From here, it will vary a little bit depending on your theme, but we basically have to redo the post loop for this page. A typical archive page will call the header, then finish with calling the sidebar and footer. We will be changing the code in between. Here is the code that a standard theme would use between the header and sidebar/footer calls:
<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;
?>
<h3>About: <?php echo $curauth->display_name; ?></h3>
<p><strong>Website:</strong> <a href=”<?php echo $curauth->user_url; ?>”><?php echo $curauth->user_url; ?></a></p>
<p><strong>Profile:</strong> <?php echo $curauth->user_description; ?></p>
<h3>Posts by <?php echo $curauth->display_name; ?>:</h3>
<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>
</li>
<?php endwhile; else: ?>
<p><?php _e(’No posts by this author.’); ?></p>
<?php endif; ?>
<!– End Loop –>
</ul>
</div>
This will display the author’s nickname, their website, and whatever is in the description field, as well as a bulleted list of all their posts. Once set up, you can control everything from within your Users panel of your WordPress dashboard. To see a list of other arguments you can get, I recommend checking out the official WordPress Author template.
As an added bonus, if you want your authors name link to point towards the authors page, you can do so with the following code:
<?php the_author_posts_link(); ?>



Thursday, January 3rd, 2008 at 5:51 pm
Awesome. This may come in handy if I ever feel the need to add additional authors to my site.
Saturday, January 5th, 2008 at 2:46 am
Great!
but I think some thing missing here
How I can tell wordpress to use authors.php page I just created not the archives.php as usually?
because I create authors.php but no changed happened in my blog?
Saturday, January 5th, 2008 at 3:36 am
hi again
you have simple mistake in your post
it is “author.php” not “authors.php”
thanks a lot
Saturday, January 5th, 2008 at 7:11 am
Amar - Thanks for the correction! I have updated the post accordingly.
Glad you both found the post useful!
Wednesday, February 6th, 2008 at 11:18 pm
but, how to add a link to all users author?
Thursday, February 7th, 2008 at 10:38 am
@ Rosyidi - Can you clarify your question?
Monday, April 14th, 2008 at 8:59 pm
Thanks so much!! This worked sweet… I am building a kind of social networking complaint site, and this was perfect for creating user profile pages… was very easy to implement.
Thanks again!
Tuesday, September 30th, 2008 at 12:04 pm
Having trouble implementing. Copy archives page, add code in appropriate spot, but only a blank white page shows. Any assistance would be greatly appreciated. By the way… love your theme!
Tuesday, September 30th, 2008 at 9:55 pm
@ Zach - Thanks! Can I get some more information? It looks like some others above have successfully completed this hack, so there is probably just some minor piece of code missing.
Thursday, October 2nd, 2008 at 6:03 am
Thanks for getting back to me so quick Kyle. I was able to get it to work. I’m now looking at a way to output the authors description formatted.
Sunday, October 5th, 2008 at 1:24 am
I managed to get the “posted by” link on the frontpage. but when i clicked the post the authers name is not there?
how to link authors name and profile in every post he writes?
Sunday, October 5th, 2008 at 4:45 am
Hi,
Thanks for this tutorial. I just did what you said in your post. But I am not sure how to call / link this author page?
Wednesday, December 10th, 2008 at 1:35 pm
Hey…the link works, but I am getting a parse error at
Fixes? Thanks!
Wednesday, December 10th, 2008 at 1:39 pm
Sorry…this line:
Sunday, December 14th, 2008 at 11:54 pm
HAHA! Awesome! This was exactly what I needed! To anybody who get’s the blank page after calling the author.php file, it’s because you need to go into to your author.php file and make it look just like your archives.php/index.php file. All you really need to do is make sure you include the following piece of the code as the first thing inside your “content” div:
Hope that helps!
Sunday, December 14th, 2008 at 11:55 pm
Woops, I should’ve known the code wouldn’t show up. I meant to copy lines 2 through 9 of the example code.
Monday, December 29th, 2008 at 4:31 pm
Hello:
I am using Revolution Lifestyle and followed the instructions with the resultant error:
Parse error: parse error, unexpected T_STRING in /home/content/c/o/a/name/html/wp-content/themes/lifestyle_20/author.php on line 24
Help please.
Sunday, January 18th, 2009 at 11:17 am
Thanks for this. Any thoughts on how to include a short bio and picture as well?
For example, I’d like to have all the author information at the top, followed by the bio, then a link to the posts by the author (not the actual posts themselves).
My issue is figuring out how and where to store the bio and photo.
Thanks!
Greg
Friday, April 3rd, 2009 at 2:00 pm
Thank you so much for this write-up! I have been trying to do this for weeks, and yours is the first set of instructions I’ve been able to follow and implement.
Tuesday, April 28th, 2009 at 9:05 pm
This worked for me, but only after I changed the quotes around ’No posts by this author.’ to straight quote (’No posts by this author’). If you’re just getting a blank page, it might be that that’s your parse issue and you don’t have PHP notices on to tell you. Try that route before you reconfigure for notices.
Trackbacks/Pingbacks
Leave A Comment
Become one of our
Featured Sites
Recent Trackbacks
Contributing Authors
Archives
Extras
WordPress Hacks Copyright © 2007-2009 | An Apricot Media Website
Template by StudioPress | Custom Design by Kyle Eslick and Blog Design Studio
RSS Feed Email RSS