BuddyDev

Search

Replies

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Dequeue bp-nouveau css #47992

    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
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Dequeue bp-nouveau css #47989

    Hi 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
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Dequeue bp-nouveau css #47979

    It 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

  • Participant
    Level: Yogi
    Posts: 1117

    Hi Brajesh, thank you, looking forward to that.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    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

  • Participant
    Level: Yogi
    Posts: 1117

    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' );
    
  • Participant
    Level: Yogi
    Posts: 1117

    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

  • Participant
    Level: Yogi
    Posts: 1117

    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

  • Participant
    Level: Yogi
    Posts: 1117

    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

  • Participant
    Level: Yogi
    Posts: 1117

    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