本来以为萨图腾的CMS模板里会有,可看了下,发现它是循环每一个分类来调用。
代码: 全选
<?php while($category->next()): ?>
<div class="index_area">
<h3><a href="<?php $category->permalink(); ?>"><?php $category->name(); ?></a></h3>
<ul>
<?php
$this->widget("Widget_Archive@$category->mid",'type=category', "mid= $category->mid" )->parse('<li><a href="{permalink}">{title}</a></li>'); ?>
</ul>
</div>
<?php endwhile; ?>
请高手支招。
typecho官方文档太少。
大家东一句西一句,常用的东西也就出来了
------------
找到了:如下,但只能显出标题
代码: 全选
<?php $this->widget("Widget_Archive@$category->mid" ,array('pageSize' => '3' ,'type' => 'category'), "mid= 2")->parse('<li><a href="{permalink}">{title}</a></li>'); ?>
请问如何把文章内容也显出来?或者摘要
---------------------
这样可以显出文章内容:
代码: 全选
<?php while($this->next()): ?>
<div class="ak-node-post-content"><?php $this->widget("Widget_Archive@$category->mid" ,array('pageSize' => '3' ,'type' => 'category'), "mid= 1")->parse('<li><a href="{permalink}">{title}</a></li>'); ?></div>
<div class="ak-node-post-content"><?php $this->content(); ?></div>
<?php endwhile; ?>
但是无法让标题与内容一一对应,总是会把指定分类下文章标题循环完了再出文章内容
纠结,怎么让标题与内容一一对应