Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Custom profile field – how to use in theme?


zoltok
Participant

@zoltok

Ok, update on progress.

I finally found some examples in the forums of people calling profile data. Here’s what I’ve currently got in my template files, this seems to be working:

$user_id = $comment->user_id;
$isMember = xprofile_get_field_data( 'Member', $user_id );
echo 'Member: '. $isMember;

The field is a radio button with only one option. This returns: a:1:{i:0;s:3:”Yes”;}

I know this is outputting some kind of array, but my knowledge gets a little shaky here. How would I target this data to conditionally do something if the value “Yes” is selected?

Skip to toolbar