开发者

How can i display avatar at wordpress single post page?

开发者 https://www.devze.com 2022-12-23 22:53 出处:网络
I tried to get avatar at single (post) page by these codes <?php echo get_avatar( $id_or_email, $size = \'96\' );

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 te开发者_如何学Pythonll me correct ways to display avatar at single post page ?


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

Also check Using Gravatars « WordPress Codex for code examples.


<?php echo get_avatar( get_the_author_meta( 'ID' ), 96 ); ?>
0

精彩评论

暂无评论...
验证码 换一张
取 消