Title: Next/Previous =&gt; same posts
Last modified: August 20, 2016

---

# Next/Previous => same posts

 *  [Claymenia](https://wordpress.org/support/users/claymenia/)
 * (@claymenia)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/nextprevious-same-posts/)
 * Hi,
 * I’ve a little problem with next/previous link… i’ve always same post for my index!
 * I ‘use old deluxe theme, and i’ve this code :
 *     ```
       <?php if(get_option('dl_home_con') != 'Pages') : ?>
   
       <?php $featured = new WP_Query('cat='.get_cat_id(get_option('dl_featured_cat')).'&showposts='.get_option('dl_featured_items')); ?>
       <?php $i=1; while ($featured->have_posts()) : $featured->the_post(); ?>
   
           <?php if($i%2==0) : add_filter('post_class','ts_post_class_alt'); endif; ?>
   
           <div <?php post_class(); ?>>
   
           	<?php if((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) : ?>
   
       		<div class="post-image"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('dl-thumb', array('alt' => ''.get_the_title().'', 'title' => ''.get_the_title().'')); ?><span class="overlay2"><img src="<?php bloginfo('template_url'); ?>/img/overlay2.png" alt="<?php the_title(); ?>" width="280" height="160"/></span></a></div>
   
       		<?php elseif(get_post_meta($post->ID, 'image_value', true)) : ?>
   
       		<div class="post-image"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_url'); ?>/lib/scripts/thumb.php?src=<?php echo ts_image(get_post_meta($post->ID, "image_value", true)); ?>&w=260&h=140&zc=1&q=95" alt="<?php the_title(); ?>" width="260" height="140"/><span class="overlay2"><img src="<?php bloginfo('template_url'); ?>/img/overlay2.png" alt="<?php the_title(); ?>" width="280" height="160"/></span></a></div>
   
       		<?php endif; // endif post thumbnail ?>
   
           	<h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
   
           	<?php the_content('',TRUE); ?>
   
           	<?php the_more(); ?>
   
       	</div><!-- end post -->
       ```
   
 * Can u help me to fix it ?
 * Thank by advance !

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/nextprevious-same-posts/#post-2113488)
 * try:
 * `<?php $featured = new WP_Query('cat='.get_cat_id(get_option('dl_featured_cat')).'&
   showposts='.get_option('dl_featured_items').'&paged='.get_query_var('paged'));?
   >`
 *  Thread Starter [Claymenia](https://wordpress.org/support/users/claymenia/)
 * (@claymenia)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/nextprevious-same-posts/#post-2113490)
 * Sorry i’ve not posted the full code :
 * _[code moderated according to [Forum Rules ](http://codex.wordpress.org/Forum_Welcome)-
   please use the [pastebin](http://pastebin.com/)]_
 * I've removed <?php $i++; endwhile; ?> and that's work except i've only one post
   show... i continue to try.
 * Thank

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

The topic ‘Next/Previous => same posts’ is closed to new replies.

## Tags

 * [home](https://wordpress.org/support/topic-tag/home/)
 * [index](https://wordpress.org/support/topic-tag/index/)
 * [link](https://wordpress.org/support/topic-tag/link/)
 * [next](https://wordpress.org/support/topic-tag/next/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [previous](https://wordpress.org/support/topic-tag/previous/)
 * [same](https://wordpress.org/support/topic-tag/same/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Claymenia](https://wordpress.org/support/users/claymenia/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/nextprevious-same-posts/#post-2113490)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
