WordPress主题制作教程6:常用模版标签

时间:2023-12-11 08:05:01

在wordpress中,模板标签指一些字段,比如标题,内容,作者,发布日期,评论数等等,获取静态值和循环里面经常使用。

输出模板标签一般有两种方式:the_yourtag() 输出标签值和get_the_yourtag()获标签值
通常来说,the_yourtag()==echo get_the_yourtag();

常用模版标签:

bloginfo('name'); 获取博客名字
bloginfo('template_directory'); 获取主题存放路径
bloginfo( 'stylesheet_url' ); style.css路径调用
bloginfo(’description’);  博客描述
the_title(); 标题
the_author();  作者
next_post_link('%link');  下一篇文章链接
previous_post_link('%link'); 上一篇文章链接

更多标签请看:

wordpress的所有模板标签