Products
GG网络技术分享 2025-03-18 16:13 0
尾部(footer)是wordpress公用的底部模板,可以拿来放统计、版权说明等代码。
在侧边栏的 DIV 标签下输入以下代码:
<div id=”footer”>
</div>
把尾部的文本放入段落标签中,你可以输入任何你想要的东西,这里是我的:
<p>
Copyright © 2007 <?php bloginfo(’name’); ?>
</p>
保存并刷新浏览器,结果如下:
© 用于显示版权符号,还记得在 header 的时候使用的 bloginfo() 函数吗?这里再次使用,“name”是用于调用博客标题,而“url”调用博客的地址。
如果你想你的博客标题成为一个链接,查下头部就知道怎么做了。
上篇文章介绍了WordPress主题开发常用模板名称和头部函数大全,这篇文章wp自学笔记收集我们在开发主题中常用模板函数,希望能给大家带来帮助。
函数名 | 描述 |
---|---|
<?php the_content(); ?> | 文章内容 |
<?php if(have_posts()): ?> | 检查是否有文章 |
<?php while(have_posts()): the_post(); ?> | 显示文章 |
<?php endwhile; ?> | 结束循环 |
<?php endif; ?> | 结束判断 |
<?php get_header(); ?> | 头部模板内容 |
<?php get_sidebar(); ?> | 侧边栏模板内容 |
<?php get_footer(); ?> | 底部模板内容 |
<?php the_time(‘m-d-y’); ?> | 显示时间,格式为:’08-18-07′ |
<?php comments_popup_link(); ?> | 显示到文章留言的链接 |
<?php the_title(); ?> | 文章标题 |
<?php the_permalink(); ?> | 文章链接 |
<?php the_category(); ?> | 文章分类 |
<?php the_author(); ?> | 文章作者 |
<?php the_ID(); ?> | 文章 ID |
<?php edit_post_link(); ?> | 文章编辑链接 |
<?php wp_list_bookmarks(); ?> | 友情链接列表 |
<?php comments_template(); ?> | 留言模板内容 |
<?php wp_list_pages(); ?> | 所有页面列表 |
<?php wp_list_categories(); ?> | 所有分类列表 |
<?php next_post_link(‘{5cc1b29162d549a8071384de182cc9fc6e6a0fd85e7907f22fd9e18cff4269c3}link’); ?> | 下一篇文章链接 |
<?php previous_post_list(‘{5cc1b29162d549a8071384de182cc9fc6e6a0fd85e7907f22fd9e18cff4269c3}link’); ?> | 上一篇文章链接 |
<?php get_calendar(); ?> | 显示文章日历 |
<?php wp_get_archives(); ?> | 存档链接列表 |
<?php posts_nav_link(); ?> | 上一篇和下一篇文章链接 |
<?php rewind_posts(); ?> | 重回开头开始第二个循环 |
<?php get_permalink(); ?> | 获取文章页面固定链接 |
扫码关注wpwp自学笔记
精选优质免费WordPress主题模板,分享最新WordPress实用建站教程!
记住我们的网址:ztJun.com
Demand feedback