wordpress如何获得当前用户的头像

    xiaoxiao2021-03-25  57

    前几天一个朋友问我,为什么他的后台一个位置的头像(主题自带的)无法显示,于是我先排查插件问题,以及主题等,后来还是无果,直接帮他注释了之前调用头像的代码,换成以下代码来获取当前登录者的头像。代码如下:

    <?php global $current_user;get_currentuserinfo();echo get_avatar( $current_user->user_email, 32); ?>

    32表示头像大小,大家可以自行调节。

    原文地址:http://liuyanzhao.com/2051.html

    转载请注明原文地址: https://ju.6miu.com/read-33136.html

    最新回复(0)