Display Author Picture Without A Plugin

25.04.10 by Jerome in Tutorials

Display Author Picture Without A Plugin

There are a few plugins out there that help you to add the author photo within a post. The one I like to use for large blogs for easy management is the User Photo plugin. For blogs with just a few nominated authors there is no point to use a plugin- just simply follow this quick tutorial below:

Step 1

In your WordPress theme folder, within the image folder, create a new folder called authors under wp-content/yourtheme/images/authors

Step 2

You need to take note of all your author’s ID. Click on the users tab and simply mouse over the number of posts of the author and check out the browser’s status bar at the bottom of your browser. You will see at the end of the URL the author id (http://www.pimpmywordpress.com/wp-admin/edit.php?author=1)

Step 3

Upload all your authors photos named as your author ID with the appropriate sizes into the authors folder wp-content/yourtheme/images/authors/3.jpg

Step 4

Simply add this code in your post loop where you wish to display the photo.

<img src="<?php bloginfo('template_directory') ?>/images/authors/<?php the_author_ID()?>.jpg" alt="<?php the_author(); ?>" title="<?php the_author(); ?>" />

Related posts:

author, photo, Tutorials

Get More Wordpress Tips & Tricks

Liked this post? subscribe to our email updates or RSS feed!

Leave a Reply

Want your picture in comment? Go to gravatar.com & upload your preferred avatar for free.

blog comments powered by Disqus