Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to display description under the name on the profile page

  • @dwdutch

    Participant

    I’m the admin for a buddypress installation (WP=2.9.2; BP=1.2.1). I activated xprofiles and use the BP default theme.

    How do you designate which field will be displayed under the name on the Profile page?

    For example, within this blog, go to My Account –> Profile –> Edit Profile then populate the “About Me” field. Magically, the contents of field is “magically” displayed under your name on the profile page.

    What setting triggers that field’s contents to be displayed in that location?

Viewing 11 replies - 1 through 11 (of 11 total)
  • @dwdutch

    Participant

    Any insight, anyone?

    @r-a-y

    Keymaster

    Read this to grab the data of a xprofile field:

    https://buddypress.org/forums/topic/editing-the-core-elements-of-buddy-press#post-41651

    You have two ways to add the xprofile field:

    1) Hook into the profile action to display custom data (preferred)

    In your child theme’s functions.php, add the following:

    function my_bp_xprofile_about_me() {
    bp_profile_field_data('field=About Me');
    }
    add_action('bp_before_member_header_meta','my_bp_xprofile_about_me');

    This method is preferred because you won’t have to worry about theme updates.

    2) Copy /bp-themes/bp-default/members/single/member-header.php to a child theme and make your changes there

    Manually add the bp_profile_field_data(‘field=About Me’) line to the file.

    @dwdutch

    Participant

    Thanks for this, @r-a-y

    @scotm

    Participant

    @r-a-y After doing this, how do you remove the field from also displaying below?

    @r-a-y

    Keymaster

    @scotm – Copy /bp-themes/bp-default/members/single/profile/profile-loop.php and modify to your heart’s content!

    You can either delete the profile loop and input the information one by one using the technique above, or omit an item by manipulating the profile loop.

    More info here:
    https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-profile-data-loop-bp_has_profile/

    @scotm

    Participant

    @r-a-y Using the technique above, preferred, can you also remove individual items such as the required ‘Name’ for instance? I see no reason why this field is displayed when it is provided above adjacent to the user avatar. Or am I hearing that omission must be done by manipulating the profile loop?

    @r-a-y

    Keymaster

    @scotm – You have control of the template, of course you can remove the “Name” field! ;)

    @scotm

    Participant

    @r-a-y I’m reaching here to figure this out:

    function my_bp_xprofile_name() {
    bp_profile_field_data(‘field=Name’);
    }
    remove_action(‘my_bp_xprofile_name’);

    @r-a-y

    Keymaster

    Hey @scotm – That’s not the correct usage.

    What I meant was copy the the template file I listed above in your child theme and remove everything in it.

    Then use bp_profile_field_data(‘field=YOURFIELD’); to list only the xprofile fields you want to list (no need to use functions and remove actions here).

    The other method is using a variation of this:
    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/faq-how-to-code-snippets-and-solutions/#post-13243

    @scotm

    Participant

    @r-a-y Gotcha. Thanks for the help…

    @gotamil

    Member

    If I’m using default buddypress theme, which functions.php do i use? Is it from /public_html/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to display description under the name on the profile page’ is closed to new replies.
Skip to toolbar