Typecho 默认标签输出:
$this->tags(', ', true, 'none');
以下代码放入 funcitons.php 文件中。
function oxcat_tags($obj) {
if (count($obj->tags) > 0):
foreach($obj->tags as $tag){
echo '<a href="'.$tag['permalink'].'" class="tag" rel="category">'.$tag['name'].'</a>';
...
作者牛猫共发表文章 94 篇。
Typecho 自定义标签页模板

设置 Typecho 标签页模板,并按标签所属文章数量从多到少排列输出。
<?php
$this->widget('Widget_Metas_Tag_Cloud', 'sort=count&ignoreZeroCount=1&desc=1')->to($tags);
if($tags->have()):
echo '<div class="tags-list">';
while ($tags -> next()):
echo '<a href="'.$tags->permalink.'...
计算机等级考试专用 WPS

从2021年3月起,全国计算机等级考试(NCRE)一、二级 WPS 科目开始使用新版的教育考试专用版 WPS Office 软件。
中国教育考试考试专用版 WPS Office 网下载地址页面:http://ncre.neea.edu.cn/html1/report/1507/861-1.htm
Typecho 提交评论数字计算验证

functions.php 文件添加
function themeInit($comment){
$comment = spam_protection_pre($comment, $post, $result);
}
function spam_protection_math(){
$num1=rand(1,49);
$num2=rand(1,49);
echo '<label for="math">请输入<code>'.$num1.'</code>+<code>'.$num2.'</code>的...
Typecho 加强评论拦截和自定义敏感词过滤

functions.php 文件添加
设置敏感词过滤后台选项和过滤敏感词函数
function themeConfig($form) {
$SensitiveWords = new Typecho_Widget_Helper_Form_Element_Textarea('SensitiveWords', NULL, NULL, _t('评论敏感词过滤'), _t('过滤词语格式:词语|词语2|词语3'));
$SensitiveWords->setAttribute('class', 'typecho-option option_main');
$form-...
JS 二维码生成插件 QRious

qRious 是一款纯 javascript 二维码生成插件。
html 代码
<canvas id="qrcodeImg"></canvas>
JS 代码
var qr = new QRious({
element: document.getElementById('qrcodeImg'),
background: 'white',
foreground: 'black',
level: 'H',
size: 150,
value: window.location.href
});
参数
参数
类型
默认值
...
jQuery 获取当前页面地址

jQuery 获取当前页面完整地址 URL
window.location.href
JS 点击实现浏览器全屏

(function () {
var viewFullScreen = document.getElementById("view-fullscreen");
if (viewFullScreen) {
viewFullScreen.addEventListener("click", function () {
var docElm = document.documentElement;
if (docElm.requestFullscreen) {
docElm.reques...
Typecho 替换全站 gravatar 头像地址

网站根目录下的 config.inc.php 文件,加入:
define('__TYPECHO_GRAVATAR_PREFIX__', 'https://cravatar.cn/avatar/'); //更换头像源
Typecho 页面判断函数

$this->is('index') //首页
$this->is('archive') //归档
$this->is('category') //分类栏目
$this->is('tag') //标签
$this->is('date') //日期归档页
$this->is('single') //内容页
$this->is('post') //内容页
$this->is('page') //独立页面
$this->is('attachment') //附件
$this->is('category','cat_sl...
最新评论