Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

How to display description under the name on the profile page (12 posts)

Started 2 years, 2 months ago by: dwdutch

  • Profile picture of dwdutch dwdutch said 2 years, 2 months ago:

    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?

  • Profile picture of dwdutch dwdutch said 2 years, 2 months ago:

    Any insight, anyone?

  • Profile picture of r-a-y r-a-y said 2 years, 2 months ago:

    Read this to grab the data of a xprofile field:

    http://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 picture of dwdutch dwdutch said 2 years ago:

    Thanks for this, @r-a-y

  • Profile picture of Scotm Scotm said 2 years ago:

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

  • Profile picture of r-a-y r-a-y said 2 years ago:

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

    http://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-profile-data-loop-bp_has_profile/

  • Profile picture of Scotm Scotm said 2 years ago:

    @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 picture of r-a-y r-a-y said 2 years ago:

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

  • Profile picture of Scotm Scotm said 2 years ago:

    @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 picture of r-a-y r-a-y said 2 years ago:

    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:

    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/faq-how-to-code-snippets-and-solutions/#post-13243

  • Profile picture of Scotm Scotm said 2 years ago:

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

  • Profile picture of GoTamil GoTamil said 1 year, 11 months ago:

    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?