Gravatar头像显示的简便方便之WordPress开发
星期一, 2015-06-29 | Author: Lee | wordpress | 3,625 views
Gravatar的头像不显示,出现个xx感觉很不舒服,想法解决;
最简单的方式是使用https的方式去显示:
调用ssl 头像链接,后台编辑functions.php加入如下代码:
1 2 3 4 5 6 | //调用ssl 头像链接 function get_ssl_avatar($avatar) { $avatar = preg_replace('/.*\/avatar\/(.*)\?s=([\d]+)&.*/','<img src="https://secure.gravatar.com/avatar/$1?s=$2&d=mm" class="avatar avatar-$2" height="$2" width="$2">',$avatar); return $avatar; } add_filter('get_avatar', 'get_ssl_avatar'); |
文章作者: Lee
本文地址: https://www.pomelolee.com/1480.html
除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址
No comments yet.
Leave a comment
Search
相关文章
热门文章
最新文章
文章分类
- ajax (10)
- algorithm-learn (3)
- Android (6)
- as (3)
- computer (85)
- Database (30)
- disucz (4)
- enterprise (1)
- erlang (2)
- flash (5)
- golang (3)
- html5 (18)
- ios (4)
- JAVA-and-J2EE (186)
- linux (143)
- mac (10)
- movie-music (11)
- pagemaker (36)
- php (50)
- spring-boot (2)
- Synology群晖 (2)
- Uncategorized (6)
- unity (1)
- webgame (15)
- wordpress (33)
- work-other (2)
- 低代码 (1)
- 体味生活 (40)
- 前端 (21)
- 大数据 (8)
- 游戏开发 (9)
- 爱上海 (19)
- 读书 (4)
- 软件 (3)