225 字
1 分钟
Wordpress 添加备案号
前言
关于 Wordpress 添加备案号,是可以通过 仪表板>>设置>>常规>>ICP备案号 中进行设置,但有些坑,然后我看了不少教程,大多也都是一下两种方法进行添加的。
html语句
由于 php 是兼容 html 语法的,所以我们就可以在 footer.php 中添加的备案信息
可以在 footer.php 的 <footer> </footer>
标签内,增加代码:
<a href="https://beian.miit.gov.cn/#/Integrated/index">你的备案号</a>
php函数
在部分的主题中 <footer>
标签是隐藏在php函数中,就比如我之前使用的Richone主题中,就是如此,它将该标签隐藏在了 wp_footer()
中,而这个函数则位于在 functions.php 中。
<?php wp_footer(); ?>
在保留Richone主题说明和链接的情况下,在它前面添加了备案号。
function richone_datefo() { echo('<div class="rb row text-center">'); echo('<a href="https://beian.miit.gov.cn/#/Integrated/index">你的备案号</a>'); echo(' Wordpress With <a href="https://richwp.com">RichWP</a>'); echo('</div></footer>');}add_action( 'wp_footer', 'richone_datefo' );
Wordpress 添加备案号
https://fuwari.vercel.app/posts/建站/wordpress/wordpress-添加备案号/