[Resolved] I want to integrate certain elements of the user profile field in the display

  • Participant
    Level: Initiated
    Posts: 13
    Christian22 on #42052
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 13
    Christian22 on #42090

    Hello Brajesh,
    Supper we were able to have the result we wanted. thank you for your valuable feedback. Just to finish with this ticket how to put the word / or word string (“Title:”) in the code below in bold, underline or in color?thank you very much.

     * Add extra fields data on member directory page.
    function buddydev_render_extra_fields_data() {
    	if ( ! bp_is_active( 'xprofile' ) ) {
    	$member_id = bp_get_member_user_id();
    	// Replace by your fields.
    	$city_field_id = 11;
    	$city = xprofile_get_field_data( $city_field_id, $member_id, 'comma' );
    	$city = $city ? __( 'Title:' ) . $city : '';
    	echo esc_html($city);
    	echo "<br>";// add new line.
    add_action( 'bp_directory_members_item', 'buddydev_render_extra_fields_data' );
    • This reply was modified 1 year, 9 months ago by Christian22.
  • Keymaster
    (BuddyDev Team)
    Posts: 23674
    Brajesh Singh on #42096

    Please change this

    echo esc_html($city);


    printf( '<strong>%s</strong>', $city );


You must be logged in to reply to this topic.

This topic is: resolved