wordpress调用指定分类目录的文章列表

      发布在:all      评论:0 条评论

在做模板的时候需要吧某个分类搞成一个单独的样式来显示,该如何调用某个指定的分类呢?

<?php query_posts('cat=20&posts_per_page=4'); while(have_posts()): the_post(); ?>   
   <li><a href="<?php the_permalink(); ?>" target="_blank"><?php the_title();?></a></li>   
<?php endwhile; wp_reset_query(); ?>

其中:

cat=20 指定要调用的分类目录ID

posts_per_page=4 调用后文章数量



Responses

滇ICP备14007443号-4