WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Add Local Avatar] Avatar upload and Customize Your Community plugin (5 posts)

  1. tawnicoakley
    Member
    Posted 4 years ago #

    I have the Customize Your Community plugin installed and when a user uploads an avatar is shows up in the /avatars directory and next to comments and such, but it won't show up next to the upload form. Can someone help me?

  2. peterwsterling
    Member
    Posted 4 years ago #

    Have you posted to the wrong area? This is about the Add Local Avatar plugin, not Customize Your Community...

  3. tawnicoakley
    Member
    Posted 4 years ago #

    Nope. I put it here, because I am using the Add Local Avatar upload. But I switched things around, so this is not needed anymore.

  4. superuntitled
    Member
    Posted 4 years ago #

    I have added the code

    if ( IS_PROFILE_PAGE ) {
    		$current_user = wp_get_current_user();
    		$uid = $current_user->ID;
    	}

    somewhere near the top of the page, and around line 177 I changed the code to

    // Try to use local avatar.
    	if($uid) {
    		$local = get_usermeta($uid, 'avatar');
    		if(!empty($local)) $src = $local;
    	}

    and now everything is fine. For some reason the code for the current user_id was not working right.

  5. superuntitled
    Member
    Posted 4 years ago #

    The above solution is wrong. It causes other troubles. I think this is correct. Around line 630...

    // Display the profile's avatar.
    if ( !$user_id ) {
    $current_user = wp_get_current_user();
    $user_id = $current_user->ID;
    }
    echo get_avatar( $user_id, 30 );

Topic Closed

This topic has been closed to new replies.

About this Topic