Gravatar不再适用于https

时间:2014-03-17 14:37:25

标签: php wordpress ssl https gravatar

几个月来,我们一直在为网站成员使用不同的默认图像,但突然间它不再有效了。

这是错误"我们无法完成此请求无法获取远程数据"直接尝试访问位于此处的图片时:http://tinyurl.com/ou7tfg3

这是functions.php文件(wordpress)中的内容

 add_filter( 'avatar_defaults', 'mytheme_default_avatar' );
 function mytheme_default_avatar( $avatar_defaults ) 
 {
     $avatar = get_option('avatar_default');

     $new_avatar_url = get_template_directory_uri() . '/images/iBDgravatar.png’, ‘http’;

     if( $avatar != $new_avatar_url )
     {
         update_option( 'avatar_default', $new_avatar_url );
     }

     $avatar_defaults[ $new_avatar_url ] = 'Default Avatar';
     return $avatar_defaults;
 }

问题:我们怎样才能将图像作为http不安全的服务?

或者有更好的解决方法吗?

将网址更改为https似乎无法修复

  add_filter( 'avatar_defaults', 'new_default_avatar' );

  function new_default_avatar ( $avatar_defaults ) {
    //Set the URL where the image file for your avatar is located
    $new_avatar_url = 'https://www.ibodyguardsdirect.com/wp-content/uploads/2013/gravatar/iBDgravatar.png';
    //Set the text that will appear to the right of your avatar in Settings>>Discussion
    $avatar_defaults[$new_avatar_url] = 'default';
    return $avatar_defaults;
   }

1 个答案:

答案 0 :(得分:3)

对于https使用" https://secure.gravatar.com/avatar/"而不是" http://www.gravatar.com/avatar/"