Display Author Photo In WordPress

September 24, 2008 · Print This Article

The beauty of WordPress is it allow multiple authors for a site or even a single post. It is a good practice to show the author photo within a post written by him/her. Besides, we can also add a short “about me” description before or after every posts.

Here we go:

Step 1
Create a new directory in at wp-content/images and name it as authors, so it will become like this directory at wp-content/images/authors.

Step 2
Upload a picture which is named the same as your author ID. Don’t know where to get your author ID? Don’t worry, here is a screenshot. Simply mouseover on the number of posts of the author and check out the browser’s status bar.

here, the author ID is 1. So, just name your picture as 1.jpg.

Step 3
Copy and paste this code to wherever you wish the photo to be displayed.


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

Step 4
If you find any problem on displaying the author photo. Firstly, Paste the URL to a browser to check whether the link is correct. For Example: http://www.livexp.net/wp-content/images/authors/1.jpg. Secondly, if you can’t access via the link. Recheck the path of the directory. If you get it right. Then should be no problem.

Mini Tips
When you are displaying the autor photo. You may also wish to let the users know a little about the author. Without access to your full about page. You can display a short description about yourself using the following code.


<?php the_author_description(); ?>

Login to your admin panel. Goto Administration > Profile > Your Profile. There is a about yourself section. Type something about yourself in the Biographical Info input field. Done!


Your choice for site templates and wordpress themes

Comments

Got something to say?

You must be logged in to post a comment.