How to change the gravatar image from front end?

They can change the image in their Gravatar account. Or set a default from the backend which isn’t what you asked originally add_filter( ‘avatar_defaults’ , ‘default_avatar’ ); function default_avatar( $avatar_defaults ){ $new_avatar = get_stylesheet_directory_uri() . ‘/images/default-gravatar.png’; $avatar_defaults[$new_avatar] = “Gravatar”; return $avatar_defaults; } Source Replace default avatar

WordPress User Gravatar images not displaying. Loading default instead

Not all your images on that page have issues. For example: http://gravatar.com/avatar/619d8e38359241a952a1f9b67f1f36cd?s=60&d=mm The rest of the images aren’t displaying because the emails you’ve encoded are not recognized with gravatar. The default image shows because you are specifying to use mm when the image can’t be found for your hash. They have several tips for normalizing … Read more

How to get User Avatar Image with link to Author and User name in Html Title tag?

My god 😛 It was as simple as html tags, I just didn’t know the correct wordpress functions to use. Here it go, for future reference: <a href=”https://wordpress.stackexchange.com/questions/305561/<?php echo get_author_posts_url( get_the_author_meta(“ID’ ), get_the_author_meta( ‘user_nicename’ ) ); ?>”> <img src=”<?php echo get_avatar_url( get_the_author_meta( ‘ID’ ) ); ?>” title=”<?php echo get_the_author(); ?>”> </img></a>

i1.wp.com url problem (Jetpack not installed)

I found the answer to your question. I’ve created a simple avatar plugin. (I edited and developed the code) if ( !function_exists( ‘get_avatar’ ) ) : function get_avatar( $id_or_email, $size=”0″, $default=””, $alt = false ) { if ( ! get_option(‘show_avatars’) ) return false; static $default_url; if ( !isset( $default_url ) ) $default_url=”http://example.com/image/my-image.png” ; if ( … Read more

Gender based user avatar

I managed to come up with the answer 😀 Thanks to @Jos function ht1_change_avatar($args, $id_or_email) { $gender = get_user_meta($id_or_email, ‘user_gender’, true); if($gender==’Male’){ $myavatar=”http://localhost:81/matrimony/wp-content/uploads/2020/04/groom.png”; }else{ $myavatar=”http://localhost:81/matrimony/wp-content/uploads/2020/04/bride.png”; } $args[‘url’] = $myavatar; return $args; } add_filter(‘get_avatar_data’, ‘ht1_change_avatar’, 100, 2);