How the change the default display of custom profile fields (withou linking, that is)?)


How can I change the default display of custom fields in member profile? If I add new fields (in a new group) from admin / Profile Fields, it shows up correctly in the theme, but linked to the search page. I want to remove the links and maybe use some styling too.

Where are the templates for that part?

Thank you

  • Alexander
    • DEV MAN’s Mascot

    Hey @dragos_roua,

    Just looked into this for you. This template is stored here:members/single/profile/profile-loop.php

    However, the search links are actually put in by BuddyPress itself. You can have them disabled by adding the following line of code inside of a plugin, or within your theme's functions.php

    remove_filter( 'bp_get_the_profile_field_value','xprofile_filter_link_profile_data', 9, 2 );

    That should do it! Let me know if you need any further assistance with this.

    Best regards, Alexander Rohmann

  • Alexander
    • DEV MAN’s Mascot

    I would start by taking a look at the function that I suggested removing
    "xprofile_filter_link_profile_data" you can find it here:

    bp-xprofile-filter.php line 156

    You could modify that code directly. Or if you wanted to avoid modifying BuddyPress directly, you could copy that function and name it something else like "custom_xprofile_filter_link_profile_data" and include it in another plugin or your theme.

    Then you could still remove the filter that uses the old function, and add a filter that uses your replacement. It should all work the same way, except now you've overridden the function and can make changes as needed.

    Best regards, Alexander Rohmann

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.