This function is from my Buddypress theme Omega, just call it using omega_get_profile_data(2,'birthday');
It will return the profile field contents that you specify, in this case 'birthday'. Be sure to create that field in the Buddypress profile setup.
It will return the profile field contents that you specify, in this case 'birthday'. Be sure to create that field in the Buddypress profile setup.
<?php
// Get Profile Data
function omega_get_profile_data($user_id,$chosen_fieldname){
if (bp_has_profile('user_id=' . $user_id)) :
while (bp_profile_groups()) : bp_the_profile_group();
while (bp_profile_fields()) : bp_the_profile_field();
if (bp_field_has_data()) :
$fieldname = bp_get_the_profile_field_name();
if($fieldname == $chosen_fieldname){$return_value = strip_tags(bp_get_the_profile_field_value());}
endif;
endwhile;
endwhile;
endif;
return $return_value;
}
?>
