Limit numer of posts per page exclude category
On my home page I have restricted the number of recent posts displayed using query_posts(‘posts_per_page=2’)
I would like to also exclude a category but can’t figure out how to integrate the two modifications to the loop.
Here’s my code:
<?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();?>
I’ve tried following a few different tutorials but can’t get them to work.
Thanks in advance!
- The topic ‘Limit numer of posts per page exclude category’ is closed to new replies.