WordPress.org

Ready to get started?Download WordPress

Forums

Add Author Profile Photo in Author Template OUTSIDE LOOP (2 posts)

  1. intricateartist
    Member
    Posted 6 years ago #

    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.

  2. latitudes
    Member
    Posted 5 years ago #

    Or you can just use my profile pic plugin, it automates the whole process.

    Use the shortcodes [printprofile] and / or [printprofilepic] within posts/pages, or the widget for outside of posts. Also comes with a bunch of template tags and an example author template.

Topic Closed

This topic has been closed to new replies.

About this Topic