@nhorstmann all the values are getting printed as comma separated values
You can add following codes inside child theme function.php and then it will add a span to them base on field type and you can add css for them.
add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_add_class_profile_data', 9, 3 );
function xprofile_filter_add_class_profile_data( $field_value, $field_type = 'textbox' ) {
global $field,$bp;
if ( 'datebox' === $field_type ) {
return $field_value;
}
if ( strpos( $field_value, ',' ) === false ) {
return $field_value;
}
if ( strpos( $field_value, ',' ) !== false ) {
// Comma-separated lists.
$list_type = 'comma';
$values = explode( ',', $field_value );
}
if ( ! empty( $values ) ) {
foreach ( (array) $values as $value ) {
$value = trim( $value );
$new_values[] = '<span class="value-' . $field_type . '">' . $value . '</span>';
}
if ( 'comma' === $list_type ) {
$values = implode( ' ', $new_values );
}
}
return $values;
}
Hey @vapvarun,
Thanks for the help, but this didn’t seem to add a span, here is the code im seeing after adding this to the function.php file
<tr class="field_77 field_communication optional-field visibility-adminsonly alt field_type_checkbox">
<td class="label">Communication</td>
<td class="data"><p>COURSE: C4 Communication, BOOK: Made To Stick by Chip and Dan Heath</p>
</td>
</tr>
Never mind, got it working! Thanks so much. I didn’t notice when I pasted it in that the first line was commented out.