在buddypress中,您可以将成员个人资料字段添加到成员标题中,以便在其用户头像旁边添加。在buddypress member-header.php中,该部分被注释掉如下:
<?php
/***
* If you'd like to show specific profile fields here use:
* bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
*/
do_action( 'bp_profile_header_meta' );
?>
我将其更改为添加配置文件字段数据“location”:
<?php
bp_member_profile_data( 'field=location’ );
do_action( 'bp_profile_header_meta' );
?>
我使用的这段代码给了我一个T_STRING错误。我没有PHP经验所以我认为这是一个简单的解决方案,因为wordpress开发人员几乎说明了如何使用这个功能。
感谢任何帮助。
答案 0 :(得分:1)
语法高亮显示器显示您的错误。你有一个时髦的名言:
bp_member_profile_data( 'field=location’ ); <--HERE
将其更改为:
bp_member_profile_data( 'field=location' );