Home  >  Article  >  Backend Development  >  typecho单独循环输出一文章的内容标题!

typecho单独循环输出一文章的内容标题!

WBOY
WBOYOriginal
2016-06-06 20:24:281566browse

typecho单独循环输出一文章的内容标题!

我想单独在一个页面上 输出我想要指定文章内容和标题

有点类似 typecho 分类下文章输出

我查了2小时百度 都没有 这方面的 文章 !只好求解了!

回复内容:

typecho单独循环输出一文章的内容标题!

我想单独在一个页面上 输出我想要指定文章内容和标题

有点类似 typecho 分类下文章输出

我查了2小时百度 都没有 这方面的 文章 !只好求解了!

不太清楚你的描述
如果你想获取某个特定的文章,譬如文章cid已知,那么可以这样:

<code>$post = $this->widget('Widget_Archive@post', 'type=post', 'cid=1');
$post->title();
</code>

如果你想获取某个特定分类下的所有文章,譬如mid已知,那么可以这样:

<code>$category = $this->widget('Widget_Archive@category', 'pageSize=6&type=category', 'mid=1');
while($category->next()){
    ... ...
}
</code>

参考:《Widget_Archive常用代码片段收集》

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn