当前位置: WordPress教程 > 主题开发 > 阅读正文

wp主题开发之footer.php

2021.4.22.   494 次   1279字

footer.php也叫页脚, 通常用来放一些版权信息, 东西不多

同样是先创建文件, 再填写内容

可以参考如下内容, 并进行修改.

<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 */
?>
</div>  <!-- 这半个div是接content的, 上面是content, 下面是footer -->

<footer class="site-footer" id="site-footer" role="contentinfo">
    <!-- 脚本版权展示	 -->
	<div id="footerdiv">
		<p style="text-align: center;margin: 10px 0px 10px 0px;color: rgb(182,137,115);">Copyright &copy 2021 朱丰华 版权所有
			<a target="_blank" href="https://beian.miit.gov.cn/" 
			    style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"> 
				辽ICP备2020012957号-2
			</a>
		</p>
		<p style="text-align:center;margin: 0px;padding: 0px;">
		    <a href="https://www.52dixiaowo.com/about.html" target="_blank">关于本站</a>
	    	<a href="https://www.52dixiaowo.com/friend.html" target="_blank">友情链接</a>
    		<a href="https://www.52dixiaowo.com/disclaimer.html" target="_blank">免责声明</a>
    		<a target="_blank" href="https://www.52dixiaowo.com/wp-content/resume/" style="text-decoration:none;">关于站长</a>
    		<a href="https://qm.qq.com/cgi-bin/qm/qr?k=wKLvv50kigbgXe81vVIsUiCYFjacCYov&jump_from=webapi">QQ交流群</a>
		</p>

		<style>
		    #footerdiv a{color: rgb(182,137,115);}
		</style>
	</div>

</footer>


</body>
</html>

接着, 同样在 index.php 中引入

此时在 index.php 中就可以看到footer中的信息

对于其他页面, 比如 single, page 都是一样的

本篇完,还有疑问?

加入QQ交流群:11500065636 IT 技术交流群