A familiarity with BP templates is going to be essential here so if you aren’t first step is to check the codex and give a quick read to the guides on working with Theme Compatibility which will help explain how to create copies of the BP templates for modification; then an understanding of how WP child themes work so you can safely modify files without losing the changes.
Then if you open member-header.php you will actually see a commented explanation on how to do what you want, you will then need to move the function to a position you want in that file i.e above/below the heading markup, wrap it in a suitable html element e.g ‘<p>’ or a span if you want to use it within the heading tag and style as wished.
Hi Hugo,
Thanks for the quick reply.
I have a child theme already set up and i have put the following code into member-header.php but i am unsure of exactly where to put it and if the code is 100% accurate?
<div id=’member_profile’>
<div class=’profile_fields’>Category: <span><?php echo bp_get_profile_field_data(array(‘Type of account’ => ‘Type of account’));?></span></div>
</div>
<?php
Why did you not use the given example in the file?
bp_member_profile_data();
That’s a self echoing function so need for ‘echo’ & it can be used in a members loop.
You can pass the args as an array but as ‘field’ & ‘user_id’ but again in the example it shows you simply (‘field=my-field’)
You can use the function as you have but no need to use it’s ‘get’ version unless you want to prevent it displaying but you can only pass the two args as mentioned ‘field’ & ‘user_id’ if you leave out user_id it defaults to displayed_user_id.
A for where it goes that’s up to you, can’t really tell you where to place it that depends on what looks right for your layout.
@jonbie
If you want to show profile data in the members loop
( as you seem to want in this thread: https://buddypress.org/support/topic/badly-need-some-help-with-a-profile-field/ )
You may be interested in this premium plugin:
BuddyProfileData
Thanks Shanebp,
I am nearly there with the code, going to keep trying rather than install another plugin.
appreciate the suggestion though.
Hi hugo,
Thanks for the instructions, i am finding it hard to follow as i am only coding a very short time with php.
I have used @modemlooper code,
<?php echo xprofile_get_field_data( ‘name of field’ );?>
it works but im not sure where to add it. I have tried everywhere within the member-header.php.
the page title in everypage is the users name. I want the profiled field to be displayed beside their name.
any ideas?