简体   繁体   English

BuddyPress显示帖子作者头像

[英]BuddyPress show post author avatar

On my home page where all my blog posts are I want to show the avatar of the author and then link it to the members profile so for example: domain.com/members/cameron. 我想在我所有博客文章所在的主页上显示作者的头像,然后将其链接到成员个人资料,例如:domain.com/members/cameron。

I have managed to get the avatar showing, just need to grab the url: <a title="View profile for <?php echo get_the_author(); ?>" href=""><?php echo get_avatar( get_the_author_meta('user_email'), $size = '32' ); ?></a> 我设法显示了头像,只需要获取url: <a title="View profile for <?php echo get_the_author(); ?>" href=""><?php echo get_avatar( get_the_author_meta('user_email'), $size = '32' ); ?></a> <a title="View profile for <?php echo get_the_author(); ?>" href=""><?php echo get_avatar( get_the_author_meta('user_email'), $size = '32' ); ?></a> Can anyone help? <a title="View profile for <?php echo get_the_author(); ?>" href=""><?php echo get_avatar( get_the_author_meta('user_email'), $size = '32' ); ?></a>有人可以帮忙吗? Thanks. 谢谢。

Can you try this? 你可以试试这个吗?

<a title="View profile for <?php echo get_the_author(); ?>"
   href="/members/<?php echo get_the_author_meta('nickname') ?>">
   <?php echo get_avatar( get_the_author_meta('user_email'), $size = '32' ); ?>
</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM