2023-09-17 更新 591 阅读

Typecho默认使用的是Gravata头像,但是Gravatar大多数的链接在国内都被墙了,图片无法加载出来,这里记录一下通过修改程序源码来替换Gravatar头像地址为国内头像源地址。

解决方法如下:

  1. 打开下面这个文件

    var/Typecho/Common.php

    搜索查找如下代码,在文件中的第836行。

    $url = $isSecure ? 'https://secure.gravatar.com' : 'http://www.gravatar.com';
  2. 替换成下面的代码即可解决问题。

    $url = $isSecure ? 'https://cravatar.cn' : 'https://cravatar.cn/avatar/';