当查看get_avatar(), 您可以看到它需要ID 或email 作为第一个参数:
get_avatar( $id_or_email, $size = \'96\', $default = \'\', $alt = false );
的来源
get_the_author_meta() 显示它将返回以下字段的数据:
\'login\', \'pass\', \'nicename\', \'email\', \'url\', \'registered\', \'activation_key\', \'status\'
除了@s\\u ha\\u dum answer之外,您还可以使用
email 用户元数据作为的第一个参数
get_avatar():
echo get_avatar( get_the_author_meta( \'email\' ), 30 );