
一、页脚文件footer.php
例如,wordpress主题使用的是simple-life主题,服务器IP为192.168.68.89,在wordpress主题文件中有个页脚文件footer.php
,这是一个包含网站页脚代码的文件。
footer.php
路径如下:
1 2 |
/www/wwwroot/192.168.68.89/wp-content/themes/simple-life/footer.php |
二、修改footer.php
,添加网站备案信息
通过ssh工具,远程连接到服务器,切换到root用户,切换到footer.php
文件所在的目录,使用vim编辑footer.php
文件。
1 2 3 4 5 6 7 8 9 |
root@iZ0sZ:/# cd /www/wwwroot/192.168.68.89/wp-content/themes/simple-life/ root@iZ0sZ:/www/wwwroot/192.168.68.89/wp-content/themes/simple-life# ls 404.php content-page.php css inc page.php searchform.php style.css vendor archive.php content.php footer.php index.php readme.txt search.php support comments.php content-search.php functions.php js rtl.css sidebar.php template content-none.php content-single.php header.php languages screenshot.png single.php third-party root@iZ0sZ:/www/wwwroot/192.168.68.89/wp-content/themes/simple-life# vim footer.php root@iZ0sZ:/www/wwwroot/192.168.68.89/wp-content/themes/simple-life# |
在footer标签内的底部添加备案信息
1 2 3 4 |
<footer> </footer> |
其中xxxxxxxxxxxxxx、豫公网安备xxxxxxxxxxxxxx号、豫ICP备yyyyyyyyyy号-1和备案图标.png,它们的路径替换成自己的网站备案信息即可。
保存后,网站首页底部备案信息如下: