• Resolved hanataloha

    (@hanataloha)


    We just started using this plugin and it’s working great to set custom local avatars. However, for users which do NOT have a local avatar image set, the Gravatar image is no longer working. The profile image just shows up as a green box for users without a local avatar image set.

    Here’s what that looks like: Screenshot of User Avatar Images

    Is there a way to fix this?

    My understanding from the plugin description was that if no local avatar was set, the Gravatar image would be the fallback (“Fully supports Gravatar and default avatars if no local avatar is set for the user”).

    Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Jeffrey Paul

    (@jeffpaul)

    @hanataloha that screenshot is behind a Flywheel login, can you please upload that somewhere else more readily accessible (e.g., https://cloudup.com)?

    Thread Starter hanataloha

    (@hanataloha)

    Oops, sorry about that!

    Here is the screenshot again:
    Screenshot of Avatar

    @hanataloha Can you please share the screenshot of Simple Local Avatar setting too? You can find it in Settings > Discussion.

    By the way, do you have another avatar plugin installed before? What are your current active plugins?

    Thread Starter hanataloha

    (@hanataloha)

    Thanks for your reply!

    Here are the Simple Local Avatar settings:
    Discussion Settings

    We are not using any other Avatar plugin. Here are the current active plugins:

    • ManageWP – Worker
    • TA Branding
    • Advanced Custom Fields
    • WP AutoTerms
    • Divi Overlays
    • Divi FilterGrid
    • Yoast Duplicate Post
    • Post SMTP
    • Redirection
    • Simple Local Avatars
    • Yoast SEO
    • Analytify – Google Analytics Dashboard
    • WP DoNotTrack
    • WP Sitemap Page

    I did try disabling all other plugins other than Simple Local Avatar, but that did not seem to change anything.

    @hanataloha do you see the solid color boxes in the discussion setting with Simple Local Avatars disabled. If yes, it should be your theme changing the gravatar to solid color boxes.

    You can double-check it by switching to default themes and deactivate/activate Simple Local Avatars.

    FYI, I can’t reproduce your issue on my end with Twentytwenty and WP 5.7.2.

    Thread Starter hanataloha

    (@hanataloha)

    Ok, I think I figured out the source of the issue! I have added this code snippet to the functions.php file, in order to use full-sized avatar images in my custom post template. This is the code I’m using (I found this in one of your other support tickets):

    // SIMPLE LOCAL AVATARS
    add_filter( 'pre_get_avatar_data', function( $args ) {
    	$args['size'] = 'full';
    	return $args;
    }, 5 );

    If I remove that code snippet, the solid color boxes go away and I see the Gravatar images.

    Is there a way to modify that code snippet to serve full sized images, but also support Gravatar as the fallback?

    Thanks for your help on this!

    Hi @hanataloha,

    Try this one to keep Gravatar support.

    add_filter( 'pre_get_avatar_data', function( $args, $id_or_email ) {
    	global $simple_local_avatars;
    	if ( $simple_local_avatars->get_simple_local_avatar_url( $id_or_email, 'full' ) ) {
    		$args['size'] = 'full';
    	}
    	return $args;
    }, 5, 2 );

    Hope this helps : )

    Thread Starter hanataloha

    (@hanataloha)

    That worked perfectly! Thank you so much for your help!

    • This reply was modified 3 years, 9 months ago by hanataloha.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Gravatar image not loading as fallback’ is closed to new replies.