Skip to:
Content
Pages
Categories
Search
Top
Bottom

How To Modify the Member’s Base Profile Template [Solved]

  • I recently learned that I can copy a template and it’s directory structure and add it to my custom theme using the same structure which essentially gives me a custom overridden template. That was pretty cool to learn (I’m a relative newbie to WP/BP development).

    Now, I want to override the BuddyPress Member’s Base Profile Page (template). I created a user-defined field and populated it on the Base Profile Page.

    I want to add some static content to template.

    Where can I locate the Member’s Base Profile template in order to make a copy of it so I can customize it?

    Thanks

Viewing 15 replies - 1 through 15 (of 15 total)

  • Roger Coathup
    Participant

    @rogercoathup

    You’ll find the various files in the members/single folder. member-header.php and home.php are ones you should start with

    Thanks @RogerCoathup.

    I ended up downloading all 28 documents from ../members/single/

    I did a search on the custom field I created and only found the edit.php template that had it. And it had it because I hard coded it in there.

    Is there a way to add static text and some php code next to a user-defined custom field that ends up making its way onto a member’s Base Profile template page?

    Frank – while I am new to BuddyPress (started it on a site today), i think you are working on similar layouts at moment that I am. The file I just finished re-working was “member-header.php” – I had added Profile Fields like Gender, Age, Etc. to display Gender for Example I used:

    ‘[?php bp_profile_field_data( ‘field=Gender’ );?]’

    basically add the name of the Profile Field you wish to display and use the Field Title name you gave it in the format above.

    Other than that its just editing CSS and adding text etc to layout. I am still working on many things – its the one area I really want to pop is the Profiles pages.

    I hope it helps!

    Well, yes and no @hotsitez….

    Here’s what I have:

    I went into WordPress/BuddyPress via wp-admin — then navigated to Buddy Press > Profile Fields

    On the Extended Profiles Fields page, I added a “Start Date” for our members to populate which is the date they started with our company. Then on the Base (Primary) tab on that page, I got my extended field positioned where I want it to display.

    Perfect (so far).

    Now what I want to do is apply some PHP to calculate how many months and years the person has been with our company and parenthetically display it next to the start date value on the member’s profile page in Buddy Press when people view a person’s profile.

    How To Do That?

    So where/how in member-header.php do I add that bit of PHP code? Note, I am a PHP coder, so I have no problem producing the code to make the calculation — I am not asking for that guidance. I simply need to know (a) what script/document file do I go to to add my code, (b) where in the page production stream in that script/document file do I add my code, and (c) how do I grab the start date value that is stored in the BuddyPress DB?

    This maybe too complicated for Buddypress to do, but I am willing to give it a shot.

    [Note: I toyed around with member-header.php per @hotsitez suggestion. The profile area that this script impacts is the upper “header’ area for a member. I am interested in getting into the flow of the Profile > Base page.]


    Roger Coathup
    Participant

    @rogercoathup

    It’s straightforward to do in BuddyPress – @hotsitez has already pointed you to the basic function for echoing profile field values (which is also documented in member-header.php), and I’ve told you which files you need to look at.

    As a PHP coder, you should be able to walk through those files to find the appropriate points in the code to hook actions in or modify your templates. You should also be able to search the BuddyPress codebase to find profile field functions you can call — start with the one @hotsitez gave you.

    You can also look on the documentation (codex) area of this site for information about the profile field loop which may help you further – and point you to how base and other profile field groups are handled.

    [Edit: and, if you want to learn about the action, filtering paradigm for development, you can find introductory articles on the wordpress.org codex]

    Ok, thanks @hotsitez

    You pointed me in the right direction. Awesome!

    I discovered that profile-loop.php is the script/template file I need to mod.

    All I need to do now is figure out how to get the value from `bp_the_profile_field_name();` and assign it to a variable. I tried `$theLabel = bp_the_profile_field_name();` but the result of the function call actually displays the label and does not allow me to assign it to the var.

    If you know how to do something like `$theLabel = get_this_bp_the_profile_field_name();` that would be my answer!


    Roger Coathup
    Participant

    @rogercoathup

    have a look in the codebase at bp_the_profile_field_name() and you’ll see the ‘get’ function that it uses.

    Trawling the codebase is the best way to find functions for BuddyPress (or the site phpftwr – google a function name and it will come up in the references)

    In this case your function is bp_get_the_profile_field_name()

    Solved…thanks @hotsitez for getting me to see that what i wanted to do was, in fact, possible and allowed me to poke around deeper.

    And thanks to @boonebgorges for this post –> https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/profile-field-adds-award/

    It helped me to get the “non-echo” function for getting profile values.

    Oh, and I see @RogerCoathup chimed in during my research and troubleshooting.

    Thanks “buddies”

    @frank13 No problem glad I could be of assistance!


    discdemo
    Participant

    @discdemo

    Hi. I just jumped in as I’m looking to see which file to edit to add this country list code I was just given. I ftp’d into /public_html/wp-content/plugins/buddypress/bp-members/ and am not seeing some of the files mentioned. I checked a level above, etc. and still not seeing. Could easily be overlooking, but thought I’d ask for a lifeline in how I might add the country code list. Currently, I added a dropdown into the base, so figured once I find the code, I can insert the list.

    Suggestions, possibly? Thank you for your time, in advance!

    jz


    discdemo
    Participant

    @discdemo

    Hi. I just jumped in as I’m looking to see which file to edit to add this country list code I was just given. I ftp’d into /public_html/wp-content/plugins/buddypress/bp-members/ and am not seeing some of the files mentioned. I checked a level above, etc. and still not seeing. Could easily be overlooking, but thought I’d ask for a lifeline in how I might add the country code list. Currently, I added a dropdown into the base, so figured once I find the code, I can insert the list.

    Suggestions, possibly? Thank you for your time, in advance!

    jz

    You shouldn’t really jump in on threads especially old threads.  Please open your own.

     

    It is far from clear what you are after after and whether this follows on from the code modemlooper wrote to add country list given to you on the other thread.


    discdemo
    Participant

    @discdemo

    Happy day to you, too! Thanks for being so interested in helping out, Hugo;-)

    I can appreciate the suggesting on where to post. I am not so sure what I have typed is being “far from clear;-)

    I’ll move along. thanks.

    I would keep the sarcasm to a minimum you are being helped out a lot by modemlooper with your requirements, sarcasm tends not to go down well or prompt people to help out.

     

    Re-opening old threads is both bad nettiquette and confusing leading to a fractured thread.

     

    Opening your own thread keeps everything in one place where people can follow along.

     

    Closing this thread.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How To Modify the Member’s Base Profile Template [Solved]’ is closed to new replies.
Skip to toolbar