我主页上的限制NUMER我已经限制使用query_posts显示最新文章的数量(“posts_per_page = 2”)的WordPress:每页帖+排除类别
我想也排除某个类别,但能不知道如何将这两个修改集成到循环中。
这里是我的原代码:
<?php query_posts('posts_per_page=2'); if (have_posts()) : while (have_posts()) : the_post();?>
<div class="date">Posted <?php the_time('F jS, Y') ?></div>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php the_content('Continue Reading →'); ?>
<?php endwhile; endif; wp_reset_query();?>
我试过以下几个不同的教程,但不能让他们的工作。我确信这是我自己的理解不足,所以对上述代码的任何明确说明或修改都将不胜感激。
在此先感谢!
其中#是您类别的ID – paislee 2012-01-04 18:19:02
@Matt H就是这样!只是不确定如何将两者结合起来。万分感谢! – dadra 2012-01-04 18:22:01
如果答案正确,请勾选它。谢谢 – 2012-01-04 18:56:19