Forums

[resolved] Authors avatar image on their posts (7 posts)

  1. geezerd
    Member
    Posted 1 year ago #

    Trying to get the author's Gravatar pic to display, but this code isn't doing it:

    <?php query_posts("author=244&showposts=1"); ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="author-feature">
    <?php echo get_avatar( get_the_author_email(), '36' ); ?>
    <h3><?php the_title(); ?></h3>
    <p style="text-align:right;">by <?php the_author() ?></p>
    <?php the_content('_'); ?>
    </div>
    <?php endwhile; ?>

    This: <?php echo get_avatar( get_the_author_email(), '36' ); ?> isn't working. Anyone know what I'm doing wrong?

  2. Chip Bennett
    Member
    Posted 1 year ago #

    get_the_author_email() is deprecated.

    Try using get_the_author_meta( 'user_email' ) instead?

  3. geezerd
    Member
    Posted 1 year ago #

    Yup, I saw that. Changed it.

    But now I get the Mystery Man pic on my post, not my Gravatar image, which IS working, because I see it in the dashboard when I look at "Users".

    ?

  4. geezerd
    Member
    Posted 1 year ago #

    ...and i see it right here, too, hahah.
    Here's where I'm testing it: http://rebellionnews.com/archives/

  5. geezerd
    Member
    Posted 1 year ago #

    Got it
    I had put 'author_email' where it should have had 'user_email'

    Thanks, Chip!

  6. Chip Bennett
    Member
    Posted 1 year ago #

    Glad you got it working!

    (p.s. you might want to check with a Forum moderator, but it appears that you may have been marked as a "bozo" (spam). I see your posts via email notification, but they're not showing up in the thread.)

  7. geezerd
    Member
    Posted 1 year ago #

    Ha, yah, they disappear when I log out.
    Geeks love the online power trip, hahah.
    I'll just log in with another email, no big.
    Thanks again, Chip.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.