Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress profile pic to wordpress avatar

  • @earl_d

    Participant

    How to get the BP profile pic to be used as the wordpress avatar

Viewing 7 replies - 1 through 7 (of 7 total)
  • @earl_d

    Participant

    Solved

    @jasminechristina

    Participant

    How resolved please.

    @jasminechristina

    Participant

    For others, I had Simple Local Avatars plugin installed which then had inserted a setting under the WP admin > discussions tab by the avatars section – which restricted avatars being selected from local store. Once this once unticked the uploaded avatars in BP synced fine.

    @nahsye84

    Participant

    I am working on a similar kind of project on buddypress where you can check some plugins here where it will look more suitable.

    @kindabisu

    Participant

    To use your BP (BuddyPress) profile picture as the WordPress avatar, you can follow these steps:

    Install and activate the “BuddyPress” plugin: Ensure that you have the BuddyPress plugin installed and activated on your WordPress site. This plugin adds social networking functionality, including user profiles, to your WordPress site.

    Upload a profile picture in BuddyPress: Go to your BuddyPress profile and upload the desired profile picture. BuddyPress allows users to customize their profile information, including the profile picture. Typically, you can find the profile settings in the user dashboard or by navigating to your profile page on the front-end of your website.

    Enable BuddyPress avatar syncing: By default, BuddyPress doesn’t automatically sync the profile picture with the WordPress avatar. You can enable this functionality by adding custom code to your theme’s functions.php file or by using a plugin specifically designed for this purpose.

    Option 1: Custom code:
    Open your theme’s functions.php file (Appearance > Theme Editor > functions.php) and add the following code snippet:

    php
    Copy code
    function bp_sync_profile_picture_with_avatar( $avatar, $id_or_email, $size, $default, $alt ) {
    if ( function_exists( ‘bp_core_fetch_avatar’ ) ) {
    $avatar = bp_core_fetch_avatar( array(
    ‘item_id’ => $id_or_email->user_id,
    ‘type’ => ‘full’,
    ‘html’ => false
    ) );
    }
    return $avatar;
    }
    add_filter( ‘get_avatar’, ‘bp_sync_profile_picture_with_avatar’, 10, 5 );
    Option 2: Use a plugin:
    Install and activate a plugin like “BuddyPress Default Avatar” or “BuddyPress Avatar Sync.” These plugins simplify the process by automatically syncing the BuddyPress profile picture with the WordPress avatar.

    Verify the avatar sync: Log out of your WordPress account and visit your website as a guest or open an incognito/private browsing window. Leave a comment or view your author bio to see if the BuddyPress profile picture is now being used as the WordPress avatar.

    By following these steps, your BuddyPress profile picture should now be synced with your WordPress avatar.

    @leandroando

    Participant

    To use your BuddyPress profile picture as your WordPress avatar, install and activate the “BuddyPress” plugin on your WordPress site. In the BuddyPress settings, ensure that the “Allow BuddyPress avatars” option is enabled under “Avatar Settings.” Save the changes, and your BuddyPress profile picture will automatically be used as your WordPress avatar in discussions and comments. Ensure you have set up BuddyPress and uploaded a profile picture within BuddyPress before using this feature.

    @fusionbudd

    Participant

    Two ways to use your BP profile pic as your WordPress avatar:
    1. Plugins:
    Install and activate a plugin like “BuddyPress Default Avatar” or “BuddyPress Avatar Sync.”
    These plugins automatically sync your BP profile photo with your WordPress avatar, making it a simple and hands-off solution.

    2. Custom code:
    If you prefer a more technical approach, you can add code to your theme’s functions.php file.
    This code snippet will enable syncing of the two avatars:

    PHP
    function bp_avatar_sync($user_id) {
    // Get BP profile picture URL
    $bp_avatar_url = bp_core_fetch_avatar(array(‘item_id’ => $user_id, ‘type’ => ‘full’));

    // Update WordPress avatar URL
    update_user_meta($user_id, ‘user_avatar’, $bp_avatar_url);
    }
    add_action(‘bp_core_avatar_uploaded’, ‘bp_avatar_sync’);

    Remember, both methods achieve the same result. Choose the method that best suits your technical skills and preferences.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar