Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author myCred

    (@designbymerovingi)

    Thread Starter Paul Thomson

    (@pthomson87)

    Thanks Gabriel,

    You thinking of introducing these features into future releases?

    Plugin Author myCred

    (@designbymerovingi)

    I have considered adding default support for a certain pre-set sized avatar but as soon as you want to make the slightest adjustment to this avatar would need to use the filter example I gave.

    Hi Gabriel
    I’ve been using avatars until the last version . After I updating I have a problem . All of the avatars are the same !!!

    Plugin Author myCred

    (@designbymerovingi)

    Hey mahdiar.

    Last version of myCRED or WordPress? If you are using the code snippet I wrote previously on this forum, you could try and change it to instead of getting an avatar based on the Users ID, get it using their email:

    add_filter( 'mycred_ranking_row', 'my_custom_ranking_rows', 10, 4 );
    function my_custom_ranking_rows( $layout, $template, $row, $position )
    {
    	$user = get_userdata( $row['user_id'] );
    	return str_replace( '%avatar%', get_avatar( $user->user_email, 32 ), $layout );
    }

    Thanks for your answer
    I use the latest version of mycred , wordpress and buddypress . I use your new code but nothing changed ! Everything except avatar works fine . It shows users’ name and their points correctly but avatars are the same .

    Plugin Author myCred

    (@designbymerovingi)

    Does avatars work in BuddyPress? is it only in the leaderboard avatars that does not show?

    Yes, other widgets that use avatars are working properly . Only the leaderboard avatars are the same . I test it in another site and I have the same issue .

    Plugin Author myCred

    (@designbymerovingi)

    I found the issue, I forgot that the user_id variable is not available instead it should just be ID.

    add_filter( 'mycred_ranking_row', 'my_custom_ranking_rows', 10, 4 );
    function my_custom_ranking_rows( $layout, $template, $row, $position )
    {
    	$avatar = get_avatar( $row['ID'], 32 );
    	return str_replace( '%avatar%', $avatar, $layout );
    }

    It has been solved .
    Thanks for your solution

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘User Avatars on myCRED List widget’ is closed to new replies.