Try bp_member_profile_data() instead.
The documentation in the code is incorrect and as you’ve noticed bp_profile_field_data() doesn’t work for the complex data types.
Hmm. I tried it but nothing shows up.
When the stored data is an array you have to process it
`$arr = bp_get_profile_field_data( ‘field=’ );
foreach ($arr as $value) {
echo “Value: $value
n”;
}`
@modemlooper – the new function I’ve given handles array data types, so you don’t have to write any of your own conditional code to catch and process array types.
You should switch your code to use bp_member_profile_data()
@PJ – not sure why the function isn’t working for you — have you got the field name correct?
Paste your code in this thread, and someone might be able to spot what you are doing wrong.
I also am getting nothing with bp_profile_field_data. It is spitting out the values in my regular theme’s member-header.php but when I plunk it into the BPMobile theme, nothing. Any ideas?
@andrewgtibbets — try the function I’ve suggested in the thread: bp_member_profile_data()
bp_profile_field_data(‘field=Company’); works in my desktop theme, not in mobile. I tried bp_member_profile_data(‘field=Company’);, still nothing.
Holy shitake mushrooms…I’m an idiot. The user I’m working with didn’t have any values in any of the fields. Please ignore. Keep moving. Nothing to see here.
Hi I am trying to display members telephone#s in the members directory using bp_profile_data_field and I was able to get the email but I was not able to get the telephone number for some reason.
I used bp_member_profile_data(‘field=31’); which I made under user profile fields.
But it still did not work. For the email I used the same exact syntax bp_member_profile_data(‘field=30’) and it worked for me.But the phone number I am having trouble with.
Any advise on how to do this would be helpful.
Running the latest version of WP/BP
Bump
Can anyone give me any insight on this?
Can anyone give me some insight into getting phonenumber to display using bp_profile_field_data() within member-loop.php
It does not work for me.
Can one of the moderators help out please.
not a moderator just a Participant
Try
Where Phone Number is an xprofile field
put the code at http://pastebin.com/Zb12M7cz in your members-loop.php
@valuser Thanks for the reply. But it still does not work.
Someone said to try this, but it does not work for me. Any reason to why do you know?
<?php echo 'phone: ‘; ?>
Thanks
I have presumed that Phone Number is the exact name of your Profile field. Is it ?
It is Telephone #.
Ooh for some reason my code didnt show up.
<?php echo 'phone: ‘; ?>
And I also tried switching Phone Number with Telephone # in the function and still does not work.
You will hit problems if you edit the data type of a field once data is stored in the db. e.g changing a text field to a checkbox will cause problems with the documented code as you need to process the array (as @modemlooper pointed out).
The easy way around changing the type of an existing field is to delete field and create a new one (don’t ‘edit’ it).