wordpress常用模板函数介绍
1.WP内置的bloginfo函数
在header.php页面中:
<h1><a href=”<?php bloginfo(’url’); ?>” title=”<?php bloginfo(’name’); ?>”><?php bloginfo(’name’); ?></a></h1>
<p><?php bloginfo(’description’); ?></p>
bloginfo(’url’)为返回网站主页链接.
bloginfo(’name’)返回网站标题
bloginfo(’description’)返回网站描述
2.WP内关于博文内容content的函数
the_ID():返回博文 ID;
the_permalink():返回博文固定链接 URL;
the_title():返回博文标题;
the_time(’M’):返回发表日期中的月份;
the_time(’d’):返回发表日期中的天;
the_author():返回博文作者;
the_category():返回博文的类别;
the_content():返回博文的内容,其中的参数表示用于“更多内容”的链接文本;
最后更新:2017-01-04 22:34:41