Replies
Hi Brajesh, thanks for your help, Iām looking forward to test this.
Do I still need the Dequeue BP Nouveau style code, or should this be deleted?
Regards
CarstenHi Brajesh, thank you š
I’ve read a post at buddypress.org that I could simply copy buddypress.css to my child theme and edit it from there. But that turns out not to be as easy as that.
No I do not want to completely remove Nouveau style, just to be able to edit in buddypress.css style sheet where all the code and selectors are already there, so I just have to changes values and colors, instead of using the inspector for inspecting and then adding changes to my custom css.
Regards
CarstenIt looks like the code is bypassing buddypress.css file. It is only some css changes to menu tabs I want to change, so what should I do from here, copy the contents from buddypress.css into a new file?
Thanks
- calu on November 14, 2022 at 10:45 am in reply to: Clarifying question about adding Xprofile fields to the members directory #47328
Hi Brajesh, thank you, looking forward to that.
Regards
Carsten - calu on November 10, 2022 at 1:36 pm in reply to: Clarifying question about adding Xprofile fields to the members directory #47279
Hi Brajesh, I have been looking at the tutorial about Fetching and Showing only Specific fields from BuddyPress XProfile data, and I can see that this is another approach, adding code into the members-loop.php, instead of bp-custom.php like KaineLabs?
I have inserted
$Fra= xprofile_get_field_data( 'Fra:' , bp_get_member_user_id() );//fetch the text for location
between bp_nouveau_before_loop(); ?> and <?php bp_nouveau_after_loop(); ?>
but the field is not displayed. Is it because the location is not defined?
Could you give me an example of the complete function?
Regards
Carsten - calu on November 9, 2022 at 7:32 pm in reply to: Clarifying question about adding Xprofile fields to the members directory #47274
Hi Brajesh, thanks for the clarification, that is very useful.
You could say that the advantage of bphelp is that it shows field name as well as data, that’s what I ment of combining, since the field name is nice to have with some xprofile fields to make sense.
But I will go with xprofile_field_get_data as you recommended.
I have managed to add age profile field to the xprofile_field_get_data code, some time ago (below), but I’m not able to reconstruct what I did then with other profile fields, so I hop the tutorial clarifies š
function yzc_add_xprofile_field_data_after_username( $name ) { if ( bp_is_members_directory() ) { $field_data = xprofile_get_field_data( 'Age:', bp_get_member_user_id() ); $field_data_gender = xprofile_get_field_data( 'Gender:', bp_get_member_user_id() ); return $name . " <span class='bp-user-age'> <br/>" . $field_data_gender . ", " . $field_data . "</span>"; } return $name; } add_filter( 'bp_member_name', 'yzc_add_xprofile_field_data_after_username', 10 ); add_filter( 'bp_rest_members_get_items_query_args', 'buddydev_exclude_logged_and_admin_users' );
- calu on November 8, 2022 at 11:01 pm in reply to: Clarifying question about adding Xprofile fields to the members directory #47260
Is it possible combining these two sets of codes into one, so you have only one set of xprofile fields under the profiles in the members directory?
Regards
Carsten - calu on November 8, 2022 at 1:45 pm in reply to: Redirect auto logged out users to frontpage on next visit to site #47255
Hi Brajesh, sorry for not seeing your reply before now, I don’t think I was notified about that.
I have the following plugins activated related to login:
BP Auto Login on Activation, BuddyPress Login Redirect to Profile, and Osom Modal Login.I have now deactivated Osom Modal Login to see if this is causing the issue.
Regards
Carsten - calu on September 13, 2022 at 2:17 pm in reply to: [Resolved] Hide header on Settings, Visits, Activity and Notifications pages #46509
Hi Brajesh, thank you for the clarification, this was a very useful information, and new to me, and probably helpful to others too.
Regards
Carsten - calu on September 13, 2022 at 9:51 am in reply to: [Resolved] Hide header on Settings, Visits, Activity and Notifications pages #46497
Hi Brajesh, sorry for the misunderstanding, adding activity’, ‘notifications’, ‘messages’, ‘settings’ to your code, works perfectly well.
1.
I’m trying to add ‘edit’ to top level nav tabs as well, using this code, and it displays as it should.
function profile_tab_yourtabname() { global $bp; bp_core_new_nav_item( array( 'name' => 'Rediger', 'slug' => 'profile/edit', 'screen_function' => false, 'position' => 10, 'parent_url' => bp_loggedin_user_domain() . 'profile/edit/', 'parent_slug' => $bp->profile->slug, 'default_subnav_slug' => 'edit', 'show_for_displayed_user' => false, //vises kun pƄ egen profil, https://wordpress.org/support/topic/create-new-buddypress-profile-tab-code-snippet/#post-15999044 ) ); } add_action( 'bp_setup_nav', 'profile_tab_yourtabname' );
But adding ‘edit’ to the array in your code does not hide the header for that component, which is weird.
2. Have you added change cover image as top level?
Yes, but I’m not sure how to add them with correct syntax? Components with hyphens, ‘change-avatar’ and ‘change-cover-image’ does not display. I have tried any combination using slashes as well, change/avatar, and change/cover/image, but without luck.
function profile_tab_yourtabname() {
global $bp;bp_core_new_nav_item( array(
‘name’ => ‘Coverbillede’,
‘slug’ => ‘profile/change-cove-/image’,
‘screen_function’ => false,
‘position’ => 10,
‘parent_url’ => bp_loggedin_user_domain() . ‘profile/change-cover-image’,
‘parent_slug’ => $bp->profile->slug,
‘default_subnav_slug’ => ‘change-cover-image’,
‘show_for_displayed_user’ => false,
) );
}add_action( ‘bp_setup_nav’, ‘profile_tab_yourtabname’ );
Regards
Carsten