Where are you putting your code? Directly in the template file or elsewhere?
And mine were Multiselect boxes, rather than checkboxes, but it should give you the same array output. For those, I had to parse the strings into something a bit more readable.
Again, I use xprofile fields, but this is what my code looks like:
<h4><strong>Arts Subcategories:</strong> <?php echo (implode( ', ', (array) xprofile_get_field_data ('Arts Subcategories'))); ?></h4>
I did not want to edit template files so I used a plugin called ‘Code Snippets’ which allows me to write code without editing the theme’s functions.php file or, like I said, the BP template files. However, to add them to the pages I had to use the “add_action()” hook.
Haha I have about 47 different plugins installed into my site and it runs fairly smoothly. The only thing is my geolocation plugin causes my page to refresh the first time you view it.
Aside from that, I found this article: http://bp-tricks.com/snippets/displaying-certain-profile-fields-on-your-members-profile-page/
In step 2 it shows PHP code to grab profile field data. You’ll have to either edit the template you want or create your own tab if you want it on a new page besides one of the pages you already have up on your site.
As far as adding social icons, I used this tutorial: https://buddypress.org/support/topic/display-users-social-follow-buttons-in-profile/
But that one requires xprofile fields.
Hope that helps some! 🙂
Possibly! what ‘current profile extension fields’ do you have or are you working with.
I only recommend xProfile Fields because I know how to use the hooks! Haha 🙂
Hi @butlerweb thanks for the response!
I’m not using xprofile fields because I didn’t want to add a birthdate field and whatnot, just wanted to display my current profile extension fields. Is that not possible without the install of xProfile Fields?
Thanks.
Does the area you want your users to write need to be like many different blog posts? Or just like a single biography section?
I can help you with code for a biography section. For that you need Xprofile Fields installed.
For blog posts, the answer I’ve gotten for that is to activate a Multisite network and then get the plugin for front-end blog posting (look for one that is compatible with BuddyPress).
I did something similar to you, I made a whole new profile page though, for my users.
First off, do you have xProfile Fields installed and active? You’ll need that.
Take a look at the page I’m working on currently: http://ishocase.net/members/chiherah/
Hi,
I’m trying to display certain profile fields on the user’s profile page. I tried the help document about Carlos and his favorite color on buddy press’s site but it did not work for me. Does any know how to do this the correct way with the modern version of buddypress? Would be a huuuuge help! Thanks!! Also would be cool to include social media link in the user’s profile page too–tried that help document on here as well to no avail.
Hope all is well!
Joe
So far this is as close as I have gotten:
public static function get_extended_fields( $user_id ) {
$fields = array();
/* Get User Extended Data */
$r = bp_parse_args( $args['args'], array(
'profile_group_id' => 0,
'user_id' => $user_id
), 'bp_xprofile_user_admin_profile_loop_args' );
$i = 0;
if ( bp_has_profile( $r ) ) {
while ( bp_profile_groups() ) {
bp_the_profile_group();
while ( bp_profile_fields() ) {
bp_the_profile_field();
$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
$fields[ $i ]['name'] = bp_get_the_profile_field_name();
$fields[ $i ]['id'] = bp_get_the_profile_field_input_name();
$fields[ $i ]['value'] = bp_get_the_profile_field_edit_value();
$i++;
}
}
}
return $fields;
}
I’m trying to create a Buddypress site where certain member names are visible and others are not to the general public. All of the Profile Fields are editable and permit me to set whether or not Everyone can see a specific profile field EXCEPT for the Name Profile Field. The Name appears in the Buddypress list whether logged in or not and I am unable to edit its visibility. Any ideas on how to get the Name field to act like other Custom Profile fields to select default visibility and whether a user can set visibility?
i am using “fine pro” theme, the child theme was created as dafault, can i use this child theme for buddypress customization? , if yes, where can i find that text CSS CODES for changing style in table profile fields? I have searched for table profile fields CSS code in buddypress default.css, but i don’t know which code is related to profile field text.
I’m new to buddypress and also i don’t know about coding. i read many forum topics regarding this problem, but I’m still confusing. Most of the people says create child theme to change buddypress profile fields text colour, but my question is, I use buddypress by installing its plugin, how can i create child theme for a plugin? i already have child theme for my website theme which is located at wp-content/themes. The profile fields text color and page background are in same color, so it makes not visible text,please anyone help me!
Has any found a plugin that displays advertisements based upon the search xprofile fields used or the search results?
I’m using the BP Profile Search plugin to search the extended xprofile fields. I want specific types of advertisements to be displayed based either what profile search fields the user entered their criteria into.
For example, if a user entered search criteria in a field called Dogs, then I want ONLY advertisements for dogs to be displayed on the search results page.
Or if a user entered search criteria in a field called Cats, then display ONLY advertisements for cats.
Does such a plugin exist? (Or is there a way to accomplish this by modifying some existing code?)
Hi @csimpson,
the answer is on the codex (bp_parse_args)
Add this to your theme’s functions.php or into bp-custom.php
function bpfr_make_name_members_only( $retval ) {
//hold all of our info
global $bp;
// is xprofile active ?
if ( bp_is_active( 'xprofile' ) )
// The user ID of the currently logged in user
$current_user_id = (int) trim($bp->loggedin_user->id);
// The author that we are currently viewing
$author_id = (int) trim($bp->displayed_user->id);
// user can see only his name && admin can see everyone
if ($current_user_id !== $author_id && !current_user_can('delete_others_pages') ) {
$retval['exclude_fields'] = '1';
}
return $retval;
}
add_filter( 'bp_after_has_profile_parse_args', 'bpfr_make_name_members_only' );
EDIT: this snippet does work only on BP 2.0+. Don’t use it with older versions.
hello all, i’m in desperate need of just making the Full Name field not a public field.
i want it to be seen by the member on their own profile and an admin, but not public when members are viewing each other’s profiles.
just like all other extended fields where you can choose visibility
bit surprised i cant find an answer to this anywhere!!
please help!
many thanks in advance, Craig
What you ask would require some custom functions being created and that would require fairly extensive php skills and knowledge of BP.
There are some connect plugins around that are BP aware, nextend google connect springs to mind as one that does populate BP profile fields with user data so it may be worth hunting around for other plugins?
@matthew_radich you should check out the code Sharmavishal wrote, it works great, and I also use Buddypress Xprofile Custom Fields. 🙂
Hi there,
i am using buddypress and the wordpress plugin “Social Login” from oneAll.
Both work pretty good, but unfortunately not together.
What i am trying to do is to get the users social data (like email adress etc) in buddypress’ extended user profile fields (custom fields) and not in the wordpress standard user profile.
The questions i have:
1. (i was also asking this question on the plugin support site) Can i control where the social login data is stored (meaning in a specific custom field)
2. If not, what i unfortunately assume, can i tell buddypress to fill its extended profile fields with the standard profile data? at least for the important stuff like e-mail.
The Background of this is i want the user to be able to edit his profile in the frontend. But as you know, extended profile needs to be used for that. after the user connects with a social account (while extended profiles are active) and wants to edit his profile, he cannot see the data like his email adress or website since it is stored in the wp standard profile.
Thanks for your help
Daniel
Thanks again Shane. I’ll try to explain again.
At high level, I want users, in their user profile, to be able to select one or more skills that they have. Skills are posts of a post type.
At lower level, I want, in a BP user profile, a field which is either a multi-select, or a set of checkboxes. The values selectable should be titles of posts from the “Skills” post type (I’ll actually save the IDs of the posts, but the titles should be displayed).
The user should be able to select these values both when registering and when editing their profile.
Possible implementations I can think of would be:
– Implement a new field TYPE called “skill”, create a field of that type in BuddyPress, and write some hooks that display and save the field.
– Add some custom code using action hooks to the bottom of the registration and edit profile screens.
I know it’s kinda hard to explain in a short forum post. There just doesn’t seem to be some simple, documented hooks that a plugin can use to extend the user profiles with new custom fields of new types and I was looking for some guidance/best practice for doing this.
Thanks again for your help.
Ross
I’m still not clear on what you’re trying to do.
Those hooks should provide a starting point.
But adding profile fields dynamically and adding/setting dynamic values to existing fields are 2 different things.
See:
buddypress\bp-xprofile\bp-xprofile-admin.php
re adding adding profile fields dynamically.
The latter item should be quite straightforward.
Then, as you point out, there is the lamentable difference between field handling in reg and profile.
Thanks Shane.
I was thinking more of something that’s like profile fields, that you edit in the member sign-up and profile edit screens, rather than creating new screens. What I’d REALLY like is something like the Group extension API for users. But instead the registration/register.php and /members/single/profile/edit.php templates seem to have a large amount of almost-duplicated code and inconsistent hooks.
Yeah, I know – if I want an extension system I should contribute it, right? 🙂
Any thoughts on adding profile fields with dynamic values in the way that I need? The best way would seem to be to use something like the bp_custom_profile_edit_fields and bp_signup_profile_fields action hooks, but I’m not sure that they are specific enough.
Thanks
Ross
Hello, I have some issues with member pages.
For some reason it repeats the 4 fields in the group 3 times in the end and the data in the field ‘fag’ 3 times.
How do I fix this?
Thanks.
Profile example
I still get this issue, now only User can see his xProfile – Even Admin can’t see other user xProfile. I have tried to switched to the Twenty Theme, but it still happens.
I have traced to here:
//I have two profile Groups, the Base group and one more I created.
// I created a User with full profile fields data.
<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<?php if ( bp_profile_group_has_fields() ) : ?>
If the user view his own profile the bp_profile_group_has_fields() will return True two times. But if another user view this user profile it will only return True 1 time and the 2nd time is false – that makes it display only Base group profile Fields and xProfile fields can’t display.
I use WP 3.9 Latest BuddyPress and installed a lot of plugins.
I want to have separate inboxes for users, all users are divided in two categories according to their profile fields. now suppose if a user from category1 posts a private message, it should go to inbox1, and if a user from category2 posts a private message, it should go to inbox2. I am using wordpress 3.9.1 Buddypress 2.0.1