The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

User Avatar
Avatar not displaying on Author Page (7 posts)

  1. flashpunk
    Posted 4 years ago #

    Hi there,
    I'm using wordpress 3.2.1 with a few plugins, all of them up to date.

    I can't seem to get the Avatar created with this plugin to display on the Author page author.php.

    Any help would be appreciated!


  2. enej
    Plugin Contributor

    Posted 4 years ago #

    To display the avatar you need to use get_avatar() function http://codex.wordpress.org/Function_Reference/get_avatar

    Hope that helps

  3. flashpunk
    Posted 4 years ago #

    Hi there, thanks for the reply.
    I am using the get_avatar() function, however it is still not working.
    i've tried it with:
    echo get_avatar( get_the_author_meta('ID'), 150 );
    echo get_avatar(get_the_author_meta('user_email', $curauth->post_author), 150);

  4. urbanty
    Posted 4 years ago #

    Hi flashpunk,

    did you solve your problem? I am stuck with the same problem.


  5. flashpunk
    Posted 4 years ago #

    Sorry, never fixed this issue.

  6. Mostafa Maklad
    Posted 4 years ago #

    You can use this code inside the loop
    <?php echo get_avatar(the_author_meta('ID'), 120);?>
    and you can use this outside the loop

    global $post;
    echo get_avatar($author_id, 120);
  7. Nessdufrat
    Posted 3 years ago #

    Hey, I'm digging up this thread, just in case somebody found a solution to the problem.
    I can't get the image to show up in the author page, the gravatar somehow takes priority on it and the url shown is that of the gravatar, not the custom user image.
    Basically, this is my author page :

    Template Name: Auteur
    get_header(); ?>
    <!-- This sets the $curauth variable -->
        $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
    <div id="content" class="<?php echo $curauth->user_nicename; ?>">
        <h1><?php echo $curauth->nickname; ?></h1>
            <dt>Site internet : </dt>
            <dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd>
            <dt>Biographie : </dt>
            <dd><?php echo $curauth->user_description; ?></dd>
        <h2>Les articles de <?php echo $curauth->nickname; ?> :</h2>
    <!-- The Loop -->
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
                <?php the_title(); ?></a>,
                <?php the_time('d M Y'); ?> dans <?php the_category('&');?>
        <?php endwhile; else: ?>
            <p><?php _e('Aucun article trouv&eacute; pour cet auteur.'); ?></p>
        <?php endif; ?>
    <!-- End Loop -->
    echo get_avatar(get_the_author_meta('ID'), 200);
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    (I was using the global $post code before, but I realized it actually didn't matter, it's working without it)
    The place where I have my call for the avatar is the only place where I can get the picture I want. If I try to place the code somewhere else, I get a blank image with an url from the gravatar website.
    I tried, of course, with the global $post.
    Nothing worked.
    So the image is stuck at the bottom of the page, which is, of course, not where I want it.
    What is wrong?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Avatar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic