Add Author Profile Photo in Author Template OUTSIDE LOOP
-
I’d been scouring the forums all morning for something about inserting a user profile photo or author image into the author template – outside of the loop. It seems no one has explained how to do this so I thought I would.
First things first, create a folder called “authors” in your wp-content directory and set file permissions to 777.
Upload photos at specified height/width into the folder. Use image type .jpg, and name the photo the EXACT nickname of your author(s). (ie. Nickname is Author1, image name should be Author1.jpg)
In your author template (outside the loop), insert this code:
<div id="authorpic"><img src="<?php bloginfo('url'); ?>/wp-content/authors/<?php echo $curauth->nickname; ?>.jpg" alt="" /></div>
In your stylesheet, add:
#authorpic {width: 100px; height: 100px; overflow: hidden; float: left; padding: 1px; border: 1px solid black; margin-right:15px;}
Change the style however you wish.
- The topic ‘Add Author Profile Photo in Author Template OUTSIDE LOOP’ is closed to new replies.