Adding a Profile Picture to an Author Page
The Author Templates page at the WordPress Codex covers the basics of an author page quite nicely, but I wasn’t able to find a way to pull in a profile image; a comment thread on Chris Cagle’s “How to use WordPress as a Membership Directory” gave me pretty much what I needed. It requires a manual upload of profile images by the admin, and a standard image size, so I would not use this solution for a large, open membership site, but it works well for this project.
<img src="http://yoursite.com/profilepics/<?php echo $curauth->ID; ?>.jpg" alt="<?php echo $curauth->nickname; ?> Profile Picture" width="125px" height="125px" />Manually upload your images to yoursite.com/profilepics (or wherever you’ll store them). Name each file #.jpg, where # corresponds to the user ID number. You can view the user ID number by visiting the Authors & Users panel (http://yoursite.com/wp-admin/users.php) and viewing the URL of the “Edit” link, which will include the string user-edit.php?user_id=# (# is the ID.)
Dani made this mess on December 31st, 2009 and filed it under WordPress
Comments are closed.
