默认分类

原因

因为个人原因,需要备案号,所以添加

教程开始

找到 functions.php 一般在目录 usr\themes\sagiri
//sagiri 是主题名字 因为文件夹文字太长 Typecho 可能会报错
//其他主题类似
在分号;后合适位置添加代码:

$bei = new Typecho_Widget_Helper_Form_Element_Text('bei', NULL, NULL, _t('工信部备案号'), _t('留空则不显示'));
$form->addInput($bei->addRule('xssCheck', _t('工信部备案号不能使用特殊字符')));

ctrl+s保存
functions.php

接着找到 footer.php 在目录 usr\themes\sagiri\component
//其他主题可能会和functions.php在同一目录,多找一找
?>后适合的位置添加代码:

<div class="blog-text-center"><a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow"><?php $this->options->bei(); ?></a></div>

ctrl+s保存
footer.php

回到Typecho后台 控制台外观设置外观 下拉找到 工信部备案号 填入备案号即可
备案号

评论

This is just a placeholder img.