调用wordpress指定分类文章2种方法

调用wordpress指定分类文章第一种方法


调用wordpress指定分类文章第二种方法

  wp_list_categories ( ' include=11&title_li=&style=none ' ) ?>

  //输出 ID 为11的分类的标题

  echo   category_description ( 11 ) ?>   //输出 ID 为11的分类的描述

  query_posts ( ' showposts=5&cat=11 ' ) ?>   //query_posts 给 The Loop 限定的条件是:显示5篇日志和分类 ID 为11

  while   ( have_posts ())  :  the_post () ?>   //The Loop 开始

  •   the_permalink ()   ?> " rel="bookmark" class="title">   the_title () ?>
  •   //用列表的方式输出带有链接的文章标题

      endwhile ?>   //The Loop 结束

    你可能感兴趣的:(wordpress,PHP)