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.
March 31st, 2009 at
5:45 PM by Damon Ledet in
Site Info, Wordpress | tags: Add new tag, author templates, codex, page author, Wordpress | Trackback: trackback

you are a star, i’ve been looking for exactly this for 2 days!!
Glad I could help you out
Nice work! How do you link to your author page from comments you make?
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?>
Thanks a bunch – worked perfectly! And as an added bonus, it even made subscriber names link to the home page. SWEET!
How can I list the coments plus an excerpt of each comment? Is there a way?
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(); ?>
Thanks you very much!!!
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?
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.
How can I list the coments plus an excerpt of each comment? Is there a way?
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?
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)
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!