简体   繁体   English

BuddyPress头像显示外部指定内容

[英]BuddyPress avatar showing up outside designated content

I have a BuddyPress member loop that includes the user avatar. 我有一个BuddyPress成员循环,其中包括用户头像。 The avatar is showing up, but outside it's wrapping html element. 化身正在显示,但在包装html元素之外。

if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) :

      $content.="<ul>";

      while ( bp_members() ) : bp_the_member();

      $content.="<li><a href='".bp_member_permalink()."'>".bp_member_avatar()."</a></li>";

   endwhile;

   $content.="</ul>";

else:

   $content.='You are not connected to any companies.';

endif;

The result is showing up with empty 结果显示为空

<ul>
  <li></li>
</ul>

And the avatars are there, but above the actual list. 化身在那里,但在实际列表上方。

在此处输入图片说明

Any help would be great! 任何帮助将是巨大的!

This function will echo the avatar: bp_member_avatar() . 此函数将回显化身: bp_member_avatar() So it will appear as your code runs, rather than append it to $content . 因此它将在您的代码运行时显示,而不是将其附加到$content Try using bp_get_member_avatar() instead. 尝试改用bp_get_member_avatar()

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

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