WordPress中不免有博主懒得去放Logo给自己的站点,可能会采用自己的Gravatar头像作为Logo,所以就有了本篇教程(和我没关系)~
获取指定ID用户头像
<?php echo get_avatar(用户id, 头像尺寸); ?>
获取文章作者头像
注意,请在循环内使用,要不然出错。
<?php echo get_avatar(get_the_author_meta('email'), 头像尺寸); ?>
获取指定邮箱头像
<?php echo get_avatar('用户邮箱', 头像尺寸); ?>