Wordpress 指定某个分类的文章到首页显示

// Get the last 10 posts in the special_cat category.
<?php query_posts('category_name=special_cat&showposts=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Do special_cat stuff... -->
<?php endwhile;?>

注意,category_name要对应后台中Category Slug中的内容,而非Category Name.

Friday, June 6th, 2008 WordPress

3 Comments to Wordpress 指定某个分类的文章到首页显示

  1. 呵呵,帮顶!来听听鬼故事……

  2. 鬼故事 on June 14th, 2008
  3. 呵呵,帮你PP顶!也请来返利看看……

  4. 返利 on June 14th, 2008
  5. 来看看你这个孩子

    不知道言留得地方对不对,,呵呵

  6. kingki on June 18th, 2008

Leave a comment