Tagged: buddypress headings
Hi Brajesh,
Thanks for coming back. I’m not too proficient with php, where do i need to add this code? Also what is the location for the profile header area, as it would be useful to add xprofile data there as well.
Many thanks, Iain
Hi Iain,
I am sorry, I haven’t been active on forum for 2 days.Which template package you using? There are different hooks and there is not guarantee of a proper placement usign hooks. Still, Ravi or I will share the snippet if you let us know the template pack being used.
Thank you
BrajeshHi Brajesh, I’m using the BuddyPress Nouveau template, so a snippet to pick up an xprofile field and place it in the buddypress home and also the top header area would be amazing!
Thanks,
IainHello lain,
You can use the following plugin to display profile field data.
https://github.com/buddydev/bp-shortcodes/archive/refs/heads/master.zipYou can use the shortcode like
Shortcode: [bp-shortcodes-profile] supported attributes 1. group_id = profile group id. 2. context = display or login // for e.q. [bp-shortcodes-profile group_id="1" context="display"]. List field data of profile group id 1 for the displayed user. Shortcode: [bpsc-profile-data] supported attributes 1. context = logged, displayed 2. field = Field id. // for e.q. [bpsc-profile-data field="1" context="displayed"]. List field data of profile field id 1 for the displayed user.
1. For Member’s home you can use a shortcode block with the above-mentioned shortcodes.
2. For Header info use the following code:add_action( 'bp_before_member_header_meta', function () { //Replace the shortcode with yours. echo do_shortcode( '[bpsc-profile-data field="1" context="displayed"]' ); } );
Please give it a try and let me know if it helps or not.
Regards
RaviHi Ravi,
That’s a great help thanks! I got the fields to input in both the header area and members home.
It took me a while to figure out how to add a css class to them but I managed to do that with trial and error. I’m pretty new to php, so it was a good learning experience.Thanks so much to you and Brajesh!
Regards,
Iain
The topic ‘ [Resolved] Change Buddypress headers on register page’ is closed to new replies.