Title: Duplicate posts appearing
Last modified: August 21, 2016

---

# Duplicate posts appearing

 *  [matatias](https://wordpress.org/support/users/matatias/)
 * (@matatias)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/duplicate-posts-appearing-1/)
 * Hi! I’m customizing the Expound theme, and I put a loop so I could show a single
   complete post from a certain category. It’s the first post at left of the Widget
   Area, below Rodin’s Thinker: [http://noblogdododo.com](http://noblogdododo.com)
 * I’ve excluded the category from all that posts above, but I can’t exclude the
   whole category from the posts below that complete post. But I’d like to prevent
   the post from appearing again right below the complete post.
 * I found this solution
    [http://wpengineer.com/1719/filter-duplicate-posts-in-the-loop/](http://wpengineer.com/1719/filter-duplicate-posts-in-the-loop/)
   So I put this code in my added loop `$do_not_duplicate[] = $post->ID;`
 * And now I’m supposed to add this code in the main loop
    `'post__not_in' => $do_not_duplicate`
 * I found the beginning of the loop in the index.php file, right after I put my“
   custom” loop, but I don’t know where to put that second line of code. I’m pasting
   the code of what I suppose it’s the theme’s main loop:
 *     ```
       <?php if ( have_posts() ) : ?>
   
       			<?php /* Start the Loop */ ?>
       			<?php while ( have_posts() ) : the_post(); ?>
   
       				<?php
       					/* Include the Post-Format-specific template for the content.
       					 * If you want to overload this in a child theme then include a file
       					 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
       					 */
       					get_template_part( 'content', get_post_format() );
       				?>
   
       			<?php endwhile; ?>
   
       			<?php expound_content_nav( 'nav-below' ); ?>
   
       		<?php elseif ( ! is_home() || is_paged() ) : ?>
   
       			<?php get_template_part( 'no-results', 'index' ); ?>
   
       		<?php else : ?>
   
       			<?php
       				$featured_posts = expound_get_featured_posts();
       				if ( ! $featured_posts->have_posts() )
       					get_template_part( 'no-results', 'index' );
       			?>
   
       		<?php endif; ?>
   
       		</div><!-- #content -->
       	</div><!-- #primary -->
       ```
   
 * Thank you!

The topic ‘Duplicate posts appearing’ is closed to new replies.

## Tags

 * [$post->id](https://wordpress.org/support/topic-tag/post-id/)
 * [duplicate posts](https://wordpress.org/support/topic-tag/duplicate-posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [matatias](https://wordpress.org/support/users/matatias/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/duplicate-posts-appearing-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
