WordPress用户头像在线调用方法

追格官方小助手/ 2022年03月29日/ WordPress/ 浏览 1184

我们在做WordPress模板开发时,经常需要调用用户的头像,我们可以用下面示例代码调用。


可以通过邮件调用avatar头像:


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


自定义头像示例代码:


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


发表评论

暂无评论,抢个沙发...

客服 工单