This topic has 5 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #133016
     eric-ria
    Participant

    The standard header for a BuddyPress member page has a picture of the avatar, @username and when they were last active.

    I would like to customize the look of this section, in the cover-image-header.php there is a comment,
    <?php
    /***
    * If you’d like to show specific profile fields here use:
    * bp_member_profile_data( ‘field=About Me’ ); — Pass the name of the field
    */

    And I am not sure how what the php would be to display the basic contact info I have created in the profile.

    So Name, City, Phone, email.

    If I can get them display, I can style it with CSS. I can attach an image of what I am looking for.

    Attachments:
    You must be logged in to view attached files.
    #133076
     Radu
    Moderator

    Yes, they can be styled with CSS but when you do the structure add a class for every element to can control it better.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #133097
     eric-ria
    Participant

    Ok so how do I in php add those elements?

    there is this line in the cover-image-header.php
    <?php
    /***
    * If you’d like to show specific profile fields here use:
    * bp_member_profile_data( ‘field=About Me’ ); — Pass the name of the field
    */

    So could I have an example of what to put her to show the user’s name?

    #133193
     Radu
    Moderator

    Hi,

    You should have low-medium PHP/HTML skills to can do that

    Here it’s a typical example

    COPY CODE
    
    <?php
    
    bp_member_profile_data( 'field=name' );
    bp_member_profile_data( 'field=city' );
    bp_member_profile_data( 'field=email' );
    bp_member_profile_data( 'field=city' );
    
    ?>
    

    Similar :

    https://archived.seventhqueen.com/forums/topic/how-to-show-extended-profile-field-value-programatically
    https://archived.seventhqueen.com/forums/topic/members-carousel-discovery-page

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #133205
     eric-ria
    Participant

    Thanks I will try this, but link to the How to show extended profile field value programatically goes to a 404 error.

    #133213
     Radu
    Moderator

    For me the link it works,

    I will attach a photo

    COPY CODE
    
    function add_custom_field()
     {
         bp_member_profile_data( 'field=Heading' );
     }
    
    add_action( 'bp_directory_members_item', 'add_custom_field');
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    Attachments:
    You must be logged in to view attached files.
Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?