在这给出一个方法,不过有点麻烦。你看着办要不要采用。
复制内容到剪贴板
代码:
<ul>
<li>分类一:</li>
<?php query_posts('cat=1&showposts=5'); ?>
<ul>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile;?>
</ul>
<li>分类二:</li>
<?php query_posts('cat=2&showposts=5'); ?>
<ul>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile;?>
</ul>
<li>分类三...</li>
...
调用每个分类下最新的5篇日志。