I was working on a site and wanted to create author pages for all registered wordpress user on the site. After looking at the documatation at http://codex.wordpress.org/Author_Templates. I came up with this code. It will show the author info as well as last 5 post and last 5 comments. You can see the code in action at my author page.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Print
  • Technorati
  • Twitter

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

14 Comments

elvis.catApril 1st, 2009 at 1:05 pm

you are a star, i’ve been looking for exactly this for 2 days!!

damonledetApril 1st, 2009 at 6:36 pm

Glad I could help you out

JeffApril 2nd, 2009 at 3:10 am

Nice work! How do you link to your author page from comments you make?

damonledetApril 2nd, 2009 at 12:35 pm

You can edit your comments.php and add this for the author line:
<a href ="<?php bloginfo('url'); ?>/?author=<?php echo $comment->user_id ?>"><?php echo $comment->comment_author?>

JeffApril 2nd, 2009 at 4:53 pm

Thanks a bunch – worked perfectly! And as an added bonus, it even made subscriber names link to the home page. SWEET!

Ben ParkerMay 8th, 2009 at 8:51 pm

How can I list the coments plus an excerpt of each comment? Is there a way?

damonledetMay 9th, 2009 at 3:47 am

Sure add comment_excerpt(); to the code in my author demo code. Just make sure it is inside the echo tag or you need to display the comment excerpt with <?php comment_excerpt(); ?>

RaphaelMay 21st, 2009 at 5:59 pm

Thanks you very much!!! ;-)

Steve HeidemanJune 5th, 2009 at 4:43 pm

Damon, Great post and great code thanks! I have a question for you. When I drop this into my theme, I get a page that is just the bare information and is unstyled…how do I wrap my theme around the author.php to style it correctly?

damonledetJune 5th, 2009 at 5:23 pm

You will have to copy the header and footer information from your theme's page template. Should look like <?php get_header(); ?> and possibly a div tag as well, depends on the theme you are using.

AHAJuly 24th, 2009 at 4:50 pm

How can I list the coments plus an excerpt of each comment? Is there a way?

JoshuaSeptember 15th, 2009 at 10:49 pm

Hey, this is great. I have almost everything I need. Now I just need to figure out how to allow visitors to post comments directly on the author.php page. So far I am not finding anything at all. Can you point me in the right direction or refer me someplace that I can find that info?

KelibiaDecember 22nd, 2009 at 5:36 am

What should I do with the code ?
Copy the file into /wp-content/plugins or copy it's content into a new wordpress page ? (after activating php in the site)

PhillipJanuary 13th, 2010 at 4:40 am

Hey Damon. Thanks for the code! Just a heads up. The line that displays biographical info of the author outputs a closing anchor tag "" . It doesn't validate due to that, but otherwise this is just what I was looking for.
Thanks!

Leave a comment

Your comment