Title: showposts from category double loop
Last modified: August 22, 2016

---

# showposts from category double loop

 *  [pixelarchitect](https://wordpress.org/support/users/pixelarchitect/)
 * (@pixelarchitect)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/showposts-from-category-double-loop/)
 * I have the following script on my page where I get the latest six posts from 
   a category:
 * <?php query_posts(‘category_name=NAME&showposts=6’); ?>
    <?php while (have_posts()):
   the_post(); ?> <?php the_title(); ?> <?php endwhile; ?>
 * This works perfect, but now I want to have a second loop from the same category
   that only shows the six posts after the first six posts that this code generates(
   so post 7 till post 12 from the category)

Viewing 1 replies (of 1 total)

 *  [roiabrazaldo](https://wordpress.org/support/users/roiabrazaldo/)
 * (@roiabrazaldo)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/showposts-from-category-double-loop/#post-5226259)
 * First, I don’t know how to do that using the wordpress library, but this will
   do it.
 *     ```
       <?php $count = 0; ?>
       <?php query_posts('category_name=NAME&showposts=12'); ?>
       <?php while (have_posts()) : the_post(); ?>
       <?php $count++;?>
       <?php if(count>6){?>
       <?php the_title(); } ?>
       <?php endwhile; ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘showposts from category double loop’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [roiabrazaldo](https://wordpress.org/support/users/roiabrazaldo/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/showposts-from-category-double-loop/#post-5226259)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
