首页
留言反馈
网站导航
推荐
毒鸡汤
Search
1
非插件为typecho 文章生成微海报分享
19,100 阅读
2
主题移动端,样式下添加二级分类
15,544 阅读
3
主题 添加author page
14,856 阅读
4
主题添加移动端下边栏
12,856 阅读
5
EMlog添加评论者邮箱等级
9,173 阅读
typecho
dynamic
SuiYu
Emlog
xiuno
登录
/
注册
Search
标签搜索
代码
xiuno
php
css
typecho
评论
模板
say
js
修改教程
标签
珍惜
努力
recommend
善良
样式
调用
微笑
颜色
插件
Vincent
累计撰写
151
篇文章
累计收到
184
条评论
首页
栏目
typecho
dynamic
SuiYu
Emlog
xiuno
页面
留言反馈
网站导航
推荐
毒鸡汤
搜索到
1
篇与
的结果
2020-09-28
Typecho评论生成随机用户头像
添加代码将下面代码添加到当前主题functions.php中:[hide]/** * 添加随机用户头像 */ function local_random_avatar($user) { $options = Typecho_Widget::widget('Widget_Options'); if($user == 'admin'){ $thumb= $options->themeUrl .'/img/avatar-default.png'; }else{ $thumb= $options->themeUrl .'/img/avatar/' . rand(1, 10) . '.png'; } $avatar = "<img alt='{$user}的头像' src='{$thumb}' class='avatar avatar-50 photo' />"; echo $avatar; }[/hide]使用方法在要调用头像的地方插入:<?php local_random_avatar($comments->author)?>bz的图像不一样显示转载自:拾光分享网
2020年09月28日
2,178 阅读
1 评论
3 点赞