Title: help with two loop site &#8211; limiting posts
Last modified: August 19, 2016

---

# help with two loop site – limiting posts

 *  [guffia](https://wordpress.org/support/users/guffia/)
 * (@guffia)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/help-with-two-loop-site-limiting-posts/)
 * I’m running a two loop site [here](http://www.highlandsinternational.org/wordpress/).
   What we want is to have the five latest posts under the category “News” show 
   up in the left column and the two latest posts under the category “Writing” show
   up in the right column. The problem is that every time you post something to 
   the site, you have to edit the template to make sure the right number of posts
   are displayed. For example, if you post a new News item, it displays it at the
   cost of a Writing item until you increase the showposts value for the Writing
   loop. It’s like the showposts values in the queries are interfering with eachother.
   Here’s the code for the loops:
 *     ```
       <div id="news">
   
       <h1>Highlands News</h1>
   
       <?php query_posts('showposts=8'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   
       <?php if (in_category('1')) continue; ?>
   
       <h2 id="post-<?php the_ID(); ?>">
   
       <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>" >
       <strong class="highlight"><?php the_time('F jS, Y') ?></strong> - <?php the_title(); ?></a> </h2>
   
       <?php   endwhile;
       endif; ?>
       </div>
   
         <div id="writing"> <h1>Highlands Writing</h1>
       <?php rewind_posts(); ?>
   
       <?php query_posts('showposts=5'); ?><?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   
       <?php if (in_category('4')) continue; ?>
   
       <h2 id="post-<?php the_ID(); ?>">
   
       <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
       "<?php the_title(); ?>" by <?php the_author_firstname() ?> </a></h2>
   
       <small><?php the_time('F jS, Y') ?> </small>
   
       <?php      the_excerpt();
          endwhile;
       endif; ?>
   
       </div>
       ```
   
 * You can see that we’ve had to bump up the showposts values several times in order
   for it to display right, but this is obviously not ideal. Can anyone tell me 
   how to fix this?

Viewing 1 replies (of 1 total)

 *  Thread Starter [guffia](https://wordpress.org/support/users/guffia/)
 * (@guffia)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/help-with-two-loop-site-limiting-posts/#post-677636)
 * Nobody has any ideas?

Viewing 1 replies (of 1 total)

The topic ‘help with two loop site – limiting posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [guffia](https://wordpress.org/support/users/guffia/)
 * Last activity: [18 years, 4 months ago](https://wordpress.org/support/topic/help-with-two-loop-site-limiting-posts/#post-677636)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
