views:

62

answers:

1

I tried to get avatar at single (post) page by these codes

  <?php
     echo get_avatar( $id_or_email, $size = '96' );
     ?>

  <?php echo get_avatar( $comment, 32 ); ?>

  <?php echo get_avatar( $id_or_email, $size, $default, $alt ); ?>

  <?php echo get_avatar( get_the_author_email(), '60' ); ?>

But no success, nothing get working. It always show default gravatar. Actually author have avatar at gravatar. But it does not show.

Can anyone please tell me correct ways to display avatar at single post page ?

+1  A: 

Do you have avatars enabled at Admin/Settings/Discussion?

Also check Using Gravatars « WordPress Codex for code examples.

songdogtech
Hi yes, it's enabled. And yes, I followed like their example, it works in other pages like index, search but not in single posting page.
spotlightsnap
Compare your loop and other code between index.php and single.php. get_avatar has to be inside the loop.
songdogtech