Title: multiple loop issue &#8211; previous posts page is wrong!?
Last modified: August 19, 2016

---

# multiple loop issue – previous posts page is wrong!?

 *  Resolved [silverlulu](https://wordpress.org/support/users/silverlulu/)
 * (@silverlulu)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-issue-previous-posts-page-is-wrong/)
 * hi!
 * i have been trying to do something where i show my newest post so it looks different
   to the other ones. i have been using multiple loops for this… that seems all 
   good, however when you click on “older posts” it has a problem as it still shows
   the newest post on each page.
 * so for example when you go to the second page, instead of having just older posts,
   the top post will be my newest post and then the older ones will be below. – 
   i only want to show my newest post on the front page. (i hope you can understand
   what i mean from my poor explanation!)
 * could someone help me on this one please? i would really appreciate it.
 * this is the site i have the problem on (i know its crap but i am trying!) [http://www.mariosuniverse.com/blog](http://www.mariosuniverse.com/blog)
 * here is my code… (thanks in advanced)
 *     ```
       <?php get_header(); ?>
       <div class="top"></div>
       <div id="main-content">
   
          <div class="loop">
   
          <?php $my_query = new WP_Query('category_name=featured&posts_per_page=1');
         while ($my_query->have_posts()) : $my_query->the_post();
         $do_not_duplicate = $post->ID;?>      
   
                 <div id="datebox">
                       <p class="day"><?php the_time('d') ?></p>
                   <p class="month"><?php the_time('M') ?></p>
                   <p class="year"><?php the_time('Y') ?></p>
               </div>
                   <div class="star"></div>
                   <div class="clear"></div>
   
             <div id="post-<?php the_ID(); ?>"> </div> <!-- did wierd stuff with this when i moved "loop" up! -->
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">                           <?php the_title(); ?></a></h2>
               <?php the_content('Read The Article / Have your say!'); ?>
   
             <!--   <p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> |
             <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>              </p> -->
   
             </div>
       <br />
       <br />
       <div class="shroom"></div>
       <br />
       <br />
       <br />
   
         <?php endwhile; ?>
   
       <?php if (have_posts()) : while (have_posts()) : the_post();
         if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
   
                    <div id="datebox">
                       <p class="day"><?php the_time('d') ?></p>
                   <p class="month"><?php the_time('M') ?></p>
                   <p class="year"><?php the_time('Y') ?></p>
              </div>
                   <div class="star"></div>
                   <div class="clear"></div>
   
                   <div class="post" id="post-<?php the_ID(); ?>">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">                           <?php the_title(); ?></a></h2>
                <?php the_content('Read The Article / Have your say!'); ?>
                <!--   <p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php                 edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> -->
   
       <br />
       <br />
       <div class="shroom"></div>
       <br />
       <br />
       <br />
       </div>
             <?php endwhile; ?>
   
             <ul>
                <li><?php next_posts_link('&laquo; Older Entries') ?></li>
                <li><?php previous_posts_link('Newer Entries &raquo;') ?></li>
             </ul>
   
          <?php else : ?>
   
             <h2>Not Found</h2>
             <p>Sorry, but you are looking for something that isn't here.</p>
             <?php include (TEMPLATEPATH . "/searchform.php"); ?>
   
          <?php endif; ?>
   
           </div>
   
       <?php get_sidebar(); ?>
   
       <?php get_footer(); ?>
       ```
   
 * [**moderated–bump removed.** Please refrain from bumping as per [Forum Rules](http://wordpress.org/support/topic/68664)]

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-issue-previous-posts-page-is-wrong/#post-1339633)
 *     ```
       <?php
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       if ($paged < 2) {
       echo 'this is page 1 of posts';
       }
       ?>
       ```
   
 *  Thread Starter [silverlulu](https://wordpress.org/support/users/silverlulu/)
 * (@silverlulu)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-issue-previous-posts-page-is-wrong/#post-1339655)
 * hi, thanks for your help, but that hasn’t seemed to help.
 * i put the code in, but it simply tells you that you are on page 1 if you are 
   on page 1 rather than only displaying the featured post on the front page. it
   still shows the featured page on page 2 etc…
 * i appreciate your assistance but do you have any other ideas, because that doesn’t
   work? thanks
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-issue-previous-posts-page-is-wrong/#post-1339656)
 * Well that code was meant to show you how to check for the first page of posts–
   replace `echo 'this is page 1 of posts';` with your code you only want on the
   first page.
 *  Thread Starter [silverlulu](https://wordpress.org/support/users/silverlulu/)
 * (@silverlulu)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-issue-previous-posts-page-is-wrong/#post-1339660)
 * oh i’m sorry i should have explained to you that i am a moron! thank you so much
   dude, this has been giving me major issues since friday and you have really sorted
   me out!
 * honestly, thank you very much. i wish you all the best!
 * LEGEND!
 * thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘multiple loop issue – previous posts page is wrong!?’ is closed to new
replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [silverlulu](https://wordpress.org/support/users/silverlulu/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-issue-previous-posts-page-is-wrong/#post-1339660)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
