Title: Stop repeat posts in wordpress
Last modified: August 19, 2016

---

# Stop repeat posts in wordpress

 *  [kzq](https://wordpress.org/support/users/kzq/)
 * (@kzq)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/stop-repeat-posts-in-wordpress/)
 * Hello!
 * I am trying to stop repeating posts from a single category on a page. I am using
   following code but I can see first function post and second function not showing
   anything any idea?
 * <?php $showpost = new WP_query(); $showpost->query(‘showposts=1&cat=6’); ?>
    
   <?php if ($showpost->have_posts()) : ?> <?php while ($showpost->have_posts()):
   $showpost->the_post(); $myPosts .= $post->ID . “,”; ?> <div class=”focus”> <h3
   >” title=”<?php the_title(); ?>”><?php the_title(); ?></h3> <div style=”padding:
   0 0 14px 0;”></div> <p>” title=”<?php the_title(); ?>”><?php print do_excerpt(
   get_the_excerpt(), $carpet[‘snippet_level2’]); ?></p> <ul class=”etc”> <li class
   =”readit”>“>Continue <li class=”commentit”>” title=”Comments on <?php the_title();?
   >”><?php comments_number(‘0 Comments’, ‘1 comment’, ‘% comments’); ?> <div class
   =”clear”></div> </div> <?php endwhile; ?> <?php endif; ?>
 * <!– Second Function –>
 * <?php $myPosts .= “0”; add_filter(‘posts_where’, ‘post_strip’); ?>
    <?php $showpost
   = new WP_query(); $showpost->query(‘showposts=12&cat=6’); ?> <?php if ($showpost-
   >have_posts()) : ?> <?php while ($showpost->have_posts()) : $showpost->the_post();
   $myPosts .= $post->ID . “,”; ?> <div class=”box_type_a recently”> <h3>” title
   =”<?php the_title(); ?>”><?php the_title(); ?></h3> <p>” title=”<?php the_title();?
   >”><?php print do_excerpt(get_the_excerpt(), $carpet[‘snippet_level2’]); ?></
   p> <ul class=”etc”> <li class=”readit”>“>Continue <li class=”commentit”>” title
   =”Comments on <?php the_title(); ?>”><?php comments_number(‘0 Comments’, ‘1 comment’,‘%
   comments’); ?> <div class=”clear”></div> </div> <?php endwhile; ?> <?php endif;?
   > <?php remove_filter(‘posts_where’, ‘post_strip’); ?>

The topic ‘Stop repeat posts in wordpress’ is closed to new replies.

## Tags

 * [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: [kzq](https://wordpress.org/support/users/kzq/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/stop-repeat-posts-in-wordpress/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
