调用第一篇最新文章
厄,到处游荡 看到下面的代码就复制,粘贴过来了。第六感告诉我以后俺会用得到的………%…¥^ 6¥选取最新的一篇文章的基本代码:
<?php query_posts(‘showposts=1′); while (have_posts()) : the_post(); ?>
<h3><a href=”<?php the_permalink() ?>” title=”<?php the_title(); ?>” rel=”bookmark”><?php the_title(); ?></a></h3>
<?php the_excerpt(‘Continue Reading »’); ?>
<?php endwhile; ?>
‘showposts=1′表示选取第一篇文章哦
<?php query_posts(‘showposts=4&offset=1′); while (have_posts()) : the_post(); ?>
‘showposts=4&offset=1′); 表示选取4篇文章,去除第一篇文章,也就是选取除去第一篇文章外的最新4篇文章
<?php query_posts(‘showposts=4&offset=1&cat=2′); while (have_posts()) : the_post(); ?>
‘showposts=4&offset=1&cat=2′ 表示选取分类ID为2的4篇文章,去除分类ID为2第一篇文章,也就是选取除去第一篇文章外的最新4篇文章
- 上一篇 > :How to choose a webhosting
- 下一篇 > :申请以@MSN.com为后缀的MSN账户






我一直没搞懂 你第一段里的 6¥ 绝对不是乱码
貌似,这就是乱码… Orz