post页面用于展示单片文章。由于post.php和archive.php都是由Widget_Archive加载,因此其api都是一样的。唯一不同的地方就是,archive.php页面中,Widget_Archive的栈中可能有多篇文章,而post页面中,则只有一篇。
这里也列出post中常用的一些api
* `$this->permalink()` 输出文章的链接
* `$this->title()` 输出文章标题
* `$this->category()` 输出分类信息。参数表示分隔符。
* `$this->content()` 输出文章内容
* `$this->expect(200)` 输出文章摘要,参数200表示输出文章的前200字符
* `$this->author()` 输出作者名称
* `$this->author->permalink()` 输出作者的链接
另外,post页面相对于index或者archive页面,一般还会有“标签”和“评论”模块。
**标签**
tags(‘,’, true, ‘none’); ?>
获取当前单篇文章的标签,用“,”符号隔开。
**评论**
调用comments页面片:
need(‘comments.php’); ?>
其中,comments页面片内容可能如下:
commentsNum(); ?>
-
comments()->to($comments); ?>
-
sequence(); ?>.
author(); ?>
next()): ?>