It seems that recently, the gravatar avatar server is completely inaccessible in China, including some methods of caching avatar images to the local. Because it was slow to access the gravatar avatar server in the past, now it is simply inaccessible and unable to download avatar images to the local.
The easiest way is to install WP China Yes plug-in To solve the problem, go to the plug-in settings page and check "Global" in the accelerated G family avatar settings.
Calling avatar with Gravatar avatar image server
Other methods for gravatar avatar image server to obtain avatar:
Add the following code to the current topic function template functions.php:
add_filter('get_avatar', function ($avatar) { return str_replace([ 'www.gravatar.com/avatar/', '0.gravatar.com/avatar/', '1.gravatar.com/avatar/', '2.gravatar.com/avatar/', 'secure.gravatar.com/avatar/', 'cn.gravatar.com/avatar/' ], 'sdn.geekzu.org/avatar/', $avatar); });
By replacing the default avatar server address with add_filter, you can modify sdn.geekzu.org/avatar/to other image server addresses.
This method can enable the front and back end to use the gravatar avatar image server at the same time, and the code is taken from the wp china yes plug-in.
Address of gravatar avatar image server provided by other netizens:
cdn.sep.cc/avatar/ sdn.geekzu.org/avatar/ cdn.v2ex.com/gravatar/ gravatar.loli.net/avatar/ gravatar.wp-china-yes.net/avatar/ gravatar.zeruns.tech/avatar/
Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!