Title: Pagination using multiple loops?
Last modified: August 18, 2016

---

# Pagination using multiple loops?

 *  [peoplestrange](https://wordpress.org/support/users/peoplestrange/)
 * (@peoplestrange)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/pagination-using-multiple-loops/)
 * Hi there, i have a doubt with the multple loops and pagination.
 * I try to use three loops but my prev and next links it does not work in any, 
   gives back ‘ not found’.
 * If anybody can check this image perhaps it can explain to me better
    [http://img524.imageshack.us/my.php?image=helpwpjk6.png](http://img524.imageshack.us/my.php?image=helpwpjk6.png)
 * My code for **“the first”** is this, here no prob, but I want show only the last
   post for the category 20.
 *     ```
       <?php if (have_posts()) : // first post cat20 ?>
       <?php $my_query = new WP_Query('cat=20&showposts=1'); ?>
       <?php while ($my_query->have_posts()) : $my_query->the_post();
        $do_not_duplicate = $post->ID; ?>
       <div id="post-<?php the_ID(); ?>" class="post firstpost">
       <div class="entry">
       <?php the_content('Continuar leyendo &raquo;'); ?>
       </div>
       </div>
       <?php endwhile; ?>
       <?php endif; ?>
       ```
   
 * Now Just below i add this:
    And here is where the problem begins. I want to show
   the last 10 post for the category 1 and include the pagination… but pagination
   does not work 🙁
 *     ```
       <div class="divider">
       <div class="news">
       <h2>Noticias</h2>
       <?php query_posts($query_string . "&cat=1");
       while (have_posts()) : the_post(); // loop continue the first post cat1 ?>
       <div class="newpost">
       <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
       <?php the_title(); ?></a>
       <?php edit_post_link('*', '<sup>', '</sup>'); ?></h2>
       <?php the_content('Continuar leyendo...'); ?>
       </div>
       <?php endwhile; ?>
       <div class="navigation"><?php posts_nav_link('','siguientes','anteriores'); ?></div>
       </div>
       ```
   
 * Now the last part is :
    I want to show only the last three post for the category
   19 and I use a custom field (url_image) and here… the pagination not work again
   🙁
 * If it is not possible that it’s in the two parts although is whereupon it works
   in this part would be perfect.
 *     ```
       <div class="images">
       <h2>Imagenes</h2>
       <?php if (have_posts() ): ?>
       <?php query_posts($query_string . "&cat=19");
       while (have_posts()) : the_post(); //second loop ?>
       <div class="themePreview" id="post-<?php the_ID(); ?>">
       <?php $url_image = get_post_meta($post->ID, "url_image", $single = false); ?>
       <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
       <?php foreach( $url_image as $url_image ) {
       echo "<img class='tmb' src='".$url_image."' alt='' />";} ?>
       </a>
       </div>
       <?php endwhile; ?>
       <div class="navigation"><?php posts_nav_link('','siguientes','anteriores'); ?></div>
       <?php else : ?>
       <h2 class="center">Not Found</h2>
       <p class="center">Sorry, but you are looking for something that isn't here.
   
       <?php endif; ?>
       ```
   
 * Thank you very much for your time.
 * Atte: People Strange

The topic ‘Pagination using multiple loops?’ is closed to new replies.

## Tags

 * [multiple loops](https://wordpress.org/support/topic-tag/multiple-loops/)
 * [pagination](https://wordpress.org/support/topic-tag/pagination/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [peoplestrange](https://wordpress.org/support/users/peoplestrange/)
 * Last activity: [18 years, 10 months ago](https://wordpress.org/support/topic/pagination-using-multiple-loops/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
