Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to display description under the name on the profile page

  • Profile photo of dwdutch
    dwdutch
    Participant

    @dwdutch

    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)
  • Profile photo of dwdutch
    dwdutch
    Participant

    @dwdutch

    Any insight, anyone?

    Profile photo of r-a-y
    r-a-y
    Moderator

    @r-a-y

    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.

    Profile photo of dwdutch
    dwdutch
    Participant

    @dwdutch

    Thanks for this, @r-a-y

    Profile photo of Scotm
    Scotm
    Participant

    @scotm

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

    Profile photo of r-a-y
    r-a-y
    Moderator

    @r-a-y

    @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/

    Profile photo of Scotm
    Scotm
    Participant

    @scotm

    @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?

    Profile photo of r-a-y
    r-a-y
    Moderator

    @r-a-y

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

    Profile photo of Scotm
    Scotm
    Participant

    @scotm

    @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’);

    Profile photo of r-a-y
    r-a-y
    Moderator

    @r-a-y

    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

    Profile photo of Scotm
    Scotm
    Participant

    @scotm

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

    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