wordpress网站首页底部栏显示网站备案信息

一、页脚文件footer.php

例如,wordpress主题使用的是simple-life主题,服务器IP为192.168.68.89,在wordpress主题文件中有个页脚文件footer.php,这是一个包含网站页脚代码的文件。
footer.php 路径如下:

bash 复制代码
/www/wwwroot/192.168.68.89/wp-content/themes/simple-life/footer.php
二、修改footer.php,添加网站备案信息

通过ssh工具,远程连接到服务器,切换到root用户,切换到footer.php文件所在的目录,使用vim编辑footer.php文件。

bash 复制代码
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标签内的底部添加备案信息

bash 复制代码
<footer>

</footer>

其中xxxxxxxxxxxxxx、豫公网安备xxxxxxxxxxxxxx号、豫ICP备yyyyyyyyyy号-1和备案图标.png,它们的路径替换成自己的网站备案信息即可。

html 复制代码
    <!-- 备案信息 -->
    <div class="footer-certification" style="width:500px;margin:0 auto; padding:20px 0;">
        <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=xxxxxxxxxxxxxx"
            style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img
                src="http://192.168.68.89/wp-content/uploads/2021/12/备案图标.png" style="float:left;" />
            <p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#FFFFFF;">豫公网安备
                xxxxxxxxxxxxxx号
            </p>
        </a>
        &nbsp;&nbsp;&nbsp;
        <a target="_blank" href="https://beian.miit.gov.cn"
            style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">
            <p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#FFFFFF;">
                豫ICP备yyyyyyyyyy号-1
            </p>
        </a>
    </div>

保存后,网站首页底部备案信息如下:


相关推荐
likfishdn21 分钟前
Linux的文件与目录管理
linux·运维·服务器
渲染101专业云渲染22 分钟前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
chian-ocean40 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=42 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
橘子味的茶二1 小时前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
追寻光1 小时前
Cannot find a valid baseurl for repo: base/7/x86_64
linux
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
陆沙2 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos