Support » Themes and Templates » How to display author image in author.php?

  • I am using author.php to display some information about my authors. I know that I can only use below user data from database:


    I’m using user_nickname; and user_description; to display author name and Bio, I also use a loop to show the list of author’s posts BUT how can I add author image??? In 2.7 you cannot provide any image for your users. Is there any turn-around in 2.7? I thought I can use gravatar but I was wrong, because you can use gravatar only in a LOOP and If I do so then I’ll have an avatar for every post of the author. I only need one photo before the author name at the top of the page. Here is my author page code:

    <?php get_header(); ?>
    global $wp_query;
    $curauth = $wp_query->get_queried_object();

    <div id=”content”>

    <div id=”left-col”>

    <h2><?php echo $curauth->nickname; ?></h2>

    <p><?php echo $curauth->description; ?></p>

    <p>Website: user_url ?>” target=”_blank”><?php echo $curauth->user_url ?>

    <!– Authors –>
    <div class=”authors”>
    <h2 class=”pdaauthors”>Posts by <?php echo $curauth->first_name ?>: (<?php the_author_posts(); ?>)</h2>
    <?php query_posts($query_string.’&posts_per_page=-1′);
    if (have_posts()) :
    echo “

    else: ?>
    <p>< ?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
    <?php endif; ?>
    <!–Authors end–>


    <?php get_sidebar(); ?>


    <?php get_footer(); ?>

  • The topic ‘How to display author image in author.php?’ is closed to new replies.