DevWebProIN Newsletter:
Last Updated:


Get Your Site Submitted for Free in the World's Largest B2B Directory!

Email Address:
* URL:
*
*Indicates Mandatory Field

Terms & Conditions


Adding Author Images To Your WordPress Install

By Debbie Campbell
Expert Author
Article Date: 2010-09-07

There are a number of plugins and tutorials for adding a gravatar image to the meta info for WordPress posts. But my client wanted the ability for each other to upload/maintain their own images within their WordPress profiles.

Here's how I did it.

First  I installed the plugin Author Image - this places a simple upload box at the bottom of a user's profile page. Nice and simple.

Next, I used the code snippet provided for the plugin and added it to the .entry-meta section beside the author link in my template page:

1<?php the_author_image(); ?>

I styled it to make it smaller, but again this was an easy task. Next, I wanted to make the image link to the author's posts page - that proved to be harder than expected, but eventually I got it working thanks to a post I found about an outdated user image plugin:

1<?php

2$author_id=$post->post_author;

3$curuser = get_userdata($author_id);

4$author_post_url=get_author_posts_url($curuser->ID, $curuser->nicename);

5echo '<a title="' . sprintf( __( " href="%27%20.%20$author_post_url%20.%20%27">user_nicename ) . '" ' . '>';

6the_author_image();

7echo '</a>';

8?>

Easy to implement and my client's authors can control their image from within their profile rather than having to update a gravatar.

Comments

About the Author:
Debbie Campbell
Red Kite Creative | Web Design Blog



Newsletter Archive | Article Archive | Submit Article | Advertising Information | About Us | Contact | Site Map

DevWebProIN is an iEntry, Inc.® publication - $line) { echo $line ; } ?> All Rights Reserved Privacy Policy and Legal
Adding Author Images To Your WordPress Install