首页显示时排除(此例为排除ID为5和6的分类)某些分类的源码。
替换掉主题中index.php文件中的
1 | <?php while (have_posts()) : the_post(); ?> |
改为
1 | <?php if ( have_posts() ) : query_posts($query_string .'&cat=-5,-6'); while ( have_posts() ) : the_post(); ?> |
即可。
首页显示时排除(此例为排除ID为5和6的分类)某些分类的源码。
替换掉主题中index.php文件中的
1 | <?php while (have_posts()) : the_post(); ?> |
改为
1 | <?php if ( have_posts() ) : query_posts($query_string .'&cat=-5,-6'); while ( have_posts() ) : the_post(); ?> |
即可。