[英]Buddypress avatar roots theme
I'm sort of new to WP and BP, is there a way to render a BP avatar in my WP roots theme? 我是WP和BP的新手,是否可以在WP根主题中渲染BP头像? I want the avatar to show in a menu bar when the use is logged in.
我希望头像在登录后显示在菜单栏中。
Yes, BP has a function you can use to output an avatar: 是的,BP具有可用于输出化身的功能:
$args = array( 'item_id' => $user_id, 'type' => 'full' );
echo bp_core_fetch_avatar( $args );
$user_id should be changed to the ID of the user you want. $ user_id应该更改为所需用户的ID。 ie
bp_displayed_user_id()
or bp_loggedin_user_id()
即
bp_displayed_user_id()
或bp_loggedin_user_id()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.