Showing Blog Author Images with WordPress

For the EnerBLOG project EnerNOC wanted a way of managing and displaying profile pics for each author. The idea behind this was to give the blog a more personal feel. To accomplish this we used the User Photo plugin for WordPress.

User Photo Plugin for WordPress

User Photo Plugin for WordPress

This plugin allows users to upload their own photo. A thumbnail is automatically generated from the photo, and both files are stored in the /wp-content/uploads/ folder.

The next step is adding the code snippets to your WordPress template so that the thumbnail and full size image show up. To do this you can use the following snippets accordingly:

< ?php userphoto($wp_query->get_queried_object()) ?>

In basic terminology what this says is: “If the User Photo plugin is activated show the corresponding thumbnail for the posts’ author here.”. This approach can be used with any of the plugins functions:

  • userphoto_the_author_photo()
  • userphoto_the_author_thumbnail()
  • userphoto_comment_author_photo()
  • userphoto_comment_author_thumbnail()

2 Responses

  1. Alex

    Hi Sam, I’d be happy to help. After you install and activate the User Photo Plugin, this is the code I’ve put in my Author.php file to get it to display:

    < ?php userphoto($wp_query->get_queried_object()) ?>

    This code will actually display the author’s picture itself. If you wrap this tag with a DIV or SPAN tag, you can further class and/or position it. Hope that helps!

  2. @KarmaTiger

    I can’t for the life of me find any notation on customizing the size of the output. I want the thumbnails to be 80 x 80 in the author bio, but only 30 x 30 in the comments. No matter what I do they come out full-sized thumbnails everywhere.

Leave a Reply

By submitting a comment here you grant Fresh Tilled Soil a perpetual license to reproduce your words and name/web site in attribution. Inappropriate comments will be removed at admin's discretion.