作者:noupe 来源:怒风的Blog   酷勤网收集 2008-08-29

摘要
  Advanced Category Excluder- 这个插件的主要目的是通过在特定页面(如:搜索结果页,RSS源列表,分类列表或者入口页面)隐藏特定分类来增强Wordpress的功能.

1. 如何在显示时排除特定分类

Advanced Category Excluder- 这个插件的主要目的是通过在特定页面(如:搜索结果页,RSS源列表,分类列表或者入口页面)隐藏特定分类来增强Wordpress的功能.

  1. <?php if ( have_posts() ) : query_posts($query_string .'&cat=-13,-26'); while ( have_posts() ) : the_post(); ?>

2. 如何显示一个分类的所有文章

如果你想显示一个分类下的特定的文章(像我用在Devsnippets的新闻区域那样)

  1. <ul  class="news">
  2.      <?php query_posts('cat=6&showposts=5'); ?>
  3.      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

原文地址:http://www.noupe.com/wordpress/most-desired-wordpress-hacks-11-common-requests-and-fixes.html
来自:http://nufeng.cn/wordpress-posts-categories-hacks/

分类: 站长经验 Web开发 网页设计

上一篇:Google Insights 百度指数:看不同企业文化的产品   下一篇:Google AdSense for Feeds扩大展示范围