喜欢的朋友们可以留意一下了!

<?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 &raquo;’); ?>

<?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篇文章

 

 

 

 

 

 

wordpress调用第一篇最新文章代码和去除第一篇

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据