Thread Starter
Divvy
(@divvy)
Thank you, @missveronicatv
That code fixed the avatar showing in full size.
But I still have problems displaying the UM avatar, only shows the default gravatar image.
Hello @divvy
Sorry for the late answer. Have you solved this problem?
Please let me know if you need our help.
Thank you.
Thread Starter
Divvy
(@divvy)
Hello @andrewshu, thank you for your reply.
Unfortunately, my problem isn’t solved yet.
Can you help me? 🙂
Hi @divvy
Please describe here your question because I read the whole discussion and didn’t quite understand what issue was left unresolved.
Thank you.
Thread Starter
Divvy
(@divvy)
@andrewshu
I love your plugin but unfortunately is not compatible with this plugin:
https://ww.wp.xz.cn/plugins/review-schema/
The user photo is not showing in my comments:
https://prnt.sc/b-oCYk-_mx2w
I have found this code in the review-schema plugin but I don’t know how to fix it to show the Ultimate Member avatar: https://paste2.org/IJy7dsDD
Hi @divvy
Try to use this code:
<?php
$avatar = '';
if ( get_comment_meta( get_comment_ID(), 'rt_anonymous', true ) ) {
$avatar = RTRS_URL . '/assets/imgs/avatar.jpg';
} else {
$user = get_user_by( 'email', $comment->comment_author_email );
if ( empty( $user ) ) {
$avatar = get_avatar_url( $comment->comment_author_email, [ 'size' => '70' ] );
} else {
$userId = $user->ID;
$avatar = um_get_user_avatar_url( $userId, '40' );
}
}
?>
Thank you.
Hello @divvy
Have you tried the code I sent? Did it help?
Thank you.
Thread Starter
Divvy
(@divvy)
Hello @andrewshu
Thank you very much, worked perfectly!! 🙂
Only my own avatar is showing in full size.
Screenshot: https://prnt.sc/W13nWGeHhs0G
Image path: wp-content/plugins/ultimate-member/assets/img/default_avatar.jpg
Any idea how to fix it?
It is the default avatar, I didn’t upload any photo.
And if I choose the Gravatar option, it shows my gravatar photo with the same full size.
Thank you in advance!
-
This reply was modified 3 years, 2 months ago by
Divvy.
Hello @divvy
Try to add the width attribute to the img tag:
<img src="<?php echo esc_url( $avatar ); ?>" alt="" width="40px">
Thank you.
Thread Starter
Divvy
(@divvy)
Hello @andrewshu
The width attribute worked perfectly, thank you once again for the help! Excellent support, hope to see the same level of support in all the WordPress plugins as yours some day 🙂