You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a plugin which allows users to upload their own avatar without using gravatar. The plugin adds a filter to the wordpress get_avatar() function to fetch the picture uploaded by user. But the avatar shown in posts and comments are still using the default gravatar.
This is the piece of code in user.js that's causing the problem. userAttributes.avatar = 'https://gravatar.com/avatar/' + userAttributes.hash + '?d=' + defaultAvatar;
How can I modify the templates to display the avatar in posts and comments using get_avatar() so it can be compatible with the other plugin filter?
I tried <?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?> but it's fetching avatar of the same author for every post.
The text was updated successfully, but these errors were encountered:
I am using a plugin which allows users to upload their own avatar without using gravatar. The plugin adds a filter to the wordpress get_avatar() function to fetch the picture uploaded by user. But the avatar shown in posts and comments are still using the default gravatar.
This is the piece of code in user.js that's causing the problem.
userAttributes.avatar = 'https://gravatar.com/avatar/' + userAttributes.hash + '?d=' + defaultAvatar;
How can I modify the templates to display the avatar in posts and comments using get_avatar() so it can be compatible with the other plugin filter?
I tried
<?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?>
but it's fetching avatar of the same author for every post.The text was updated successfully, but these errors were encountered: