typehco自定头部header信息义
首页keywords和Description内容:使用这样的代码,可以自定义相关header内容:
<?php if($this->is('index')): ?>
<?php $this->header('description=介绍内容。'); ?>
<?php else: ?>
<?php $this->header(); ?><?php endif; ?>
彻底删除Typecho模版中程序版本号、模版名称等多余Meta标签
<?php $this->header('generator=&template=&pingback=&xmlrpc=&wlw=&atom=&rss1=&rss2='); ?>
请替换模版中<?php $this->header(); ?>,考虑SEO友好所以保留description及keywords如果其它有需求可以自行保留比如rss,一般都会在界面增加rss按钮一般可以为浏览器等工具提供探测。
基本用法:
keywords= (表示替换keywords标签内容,当"="后面没有内容则表示屏蔽调用,也就是删除)
& (处理多个时用到,如果有下一个需要屏蔽放下一个前面区隔开就可以了)
值解释:
内容描述/description: <meta name="description" content="随意" />
关键字/keywords:<meta name="keywords" content="随意" />
程序信息/generator:<meta name="generator" content="Typecho 0.9/13.12.12" />
模版名/template:<meta name="template" content="abc" />
文章引用/pingback:<link rel="pingback" href="https://abc.com/action/xmlrpc" />
离线写作接口/xmlrpc:<link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://yijile.com/action/xmlrpc?rsd" />
离线写作接口/wlw:<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://abc/action/xmlrpc?wlw" />
Feed地址/rss2:<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="https://yijile.com/feed/" />
Feed地址rss旧版/rss1:<link rel="alternate" type="application/rdf+xml" title="RSS 1.0" href="https://yijile.com/feed/rss/"; />
Feed atom(应该可以说是比rss2兼容性更好吧)/atom:<link rel="alternate" type="application/atom+xml" title="ATOM 1.0" href="https://yijile.com/feed/atom/"; />
上面有提到当“=”后面没有内容就将值屏蔽了,如果“=”后面有内容就代替默认的
如:generator=Wordpress,那么前端调用后就是<meta name="generator" content="Wordpress" />
这样就伪装为wp了
文章由官网发布,如若转载,请注明出处:https://www.dpaoz.com/220
0 评论
2k
发表评论

热门文章
自媒体博客Spimes主题11w 阅读
Spimes主题专为博客、自媒体、资讯类的网站设计....
Spzac个人资讯下载类主题6.7w 阅读
用于作品展示、资源下载,行业垂直性网站、个人博客,....
vCard主题个人简历主题6.5w 阅读
一款个人简历主题,可以简单搭建一下,具体也比较简单....
Splity博客双栏主题4.9w 阅读
仿制主题,Typecho博客主题,昼夜双版设计,可....
热评文章
自媒体博客Spimes主题337 评论
Splity博客双栏主题171 评论
Spzac个人资讯下载类主题82 评论
Spzhi知识付费社区主题34 评论
Splinx博客图片主题33 评论
vCard主题个人简历主题27 评论
Pure轻简主题23 评论
Spkan视频影视类模板21 评论
axiomxs
昨天 22:26
作者老大哥,求说说页面啊