修改 meta
<meta name="keywords" content="牛猫">
jQuery
$('meta[name="keywords"]').attr('content',"oxcat" );
js
var metaList = document.getElementsByTagName("meta");
for (var i = 0; i < metaList.length; i++) {
if (metaList[i].getAttribute("name") == "keywords") {
metaList[i].conte...
栏目网站代码下共有文章 36 篇。
Windows 服务器安装 thinkphp6

安装 php
thinkphp6 要求 php 版本要求:>7.1
php下载地址:https://www.php.net/downloads
安装 composer
composer 下载:Composer-Setup.exe
官网下载页面:getcomposer.org/download/
安装,下一步、下一步,选择 php.exe 路径
如果提示 ftp 模块已启动错误,打开 php.ini 关闭一个 ftp ext
重启系统
安装 tinkphp6
打开 cmd, cd 到安装 thinkphp6 的目录,如 tp,输入
composer create-project to...
Typecho 自定义模板头部信息

于主题模板文件夹中的 header.php 文件
<?php $this->header(); ?>
设置以下参数
keywords:关键词
description:描述、摘要
rss1:feed rss1.0
rss2:feed rss2.0
atom:feed atom
generator:程序版本等
template:模板名称
pingback:文章引用
xmlrpc:离线写作
wlw:m$的离线写作工具
commentReply:评论回复
不想显示的在 = 后面留空即可,如:
<?php $this->header('generator=&...
display:flex 子元素固定宽度和对齐

.parent {
display: flex;
flex-wrap: wrap;
}
.children {
width: 50%;
}
flex-flow 子元素排列方式,是 flex-direction 和 flex-wrap 属性的复合属性,默认值: row nowrap。
方向 flex-direction 属性:
row 横
row-reverse 横 倒序
column 列
column-reverse 列 倒序
是否拆行或拆列 flex-wrap 属性:
nowrap 不换行
wrap 换行
wrap-reverse 镜像
justi...
Tyepcho 输出当前文章所属分类的所有子分类

$this->widget('Widget_Metas_Category_List')->to($categories);
while($categories->next()):
if($this->category == $categories->slug && ($this->is("post") || $this->is("category"))){
$childrens = $this->widget('Widget_Metas_Category_List')->getAllChildr...
Tyepcho 自定义文章标签输出

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>';
...
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.'...
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
});
参数
参数
类型
默认值
...
最新评论