Title: problem with do not duplicate
Last modified: August 20, 2016

---

# problem with do not duplicate

 *  [andy3000](https://wordpress.org/support/users/andy3000/)
 * (@andy3000)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/problem-with-do-not-duplicate/)
 * Goal show table with 3 posts from cat:AccordionPg1 on row 1 and next 3 post on
   row 2. Before I added the do not duplicate code I had it right except second 
   row contained the same three posts as the first. Now I only get one row of three
   posts. Sorry site not on internet.
 *     ```
       <?php
       /*
       Template Name: nosidebar3
       */
        ?>
       <?php // Do not delete these lines ?>
       <?php 	/* get all options: */
       # error_reporting(-1);
       include (TEMPLATEPATH . '/functions/bfa_get_options.php');
       global $bfa_ata;
   
       $left_col2 = "off";
       $left_col ="off";
       $right_col2 = "off";
       $right_col = "off";
   
       get_header(); ?>
   
       <div style="margin:0 auto;">
       <table style="text-align:left; width:100%; margin-left:0px auto;
       margin-right:0px auto;" border="1"
        cellpadding="2" cellspacing="2">
         <tbody>
       <tr>
       <td style="width:33%;">
       <?php $accordion1 = new
       WP_Query('category_name=AccordionPg1&showposts=3');
       while($accordion1->have_posts()) : $accordion1->the_post();
       $do_not_duplicate[] =$post->ID ?>
        <h3><?php the_title(); ?></h3>
              <?php the_content(); ?>
       </td>
             <td style="width:33%;" align="undefined"
        valign="undefined">
           <?php endwhile; ?>
       </td></tr>
       <tr><td style="width:33%;" align="undefined"
        valign="undefined">
       <?php rewind_posts();  ?>
       <?php $accordion2 = new
       WP_Query('category_name=AccordionPg1&showposts=3');
       while($accordion2->have_posts()) : $accordion2->the_post();
         if  (in_Array($post->ID, $do_not_duplicate)) continue;
       update_post_caches
       ($posts); ?>
              <h3><?php the_title(); ?></h3>
              <?php the_content(); ?>
       </td>
             <td style="width:33%;" align="undefined"
        valign="undefined">
       <?php endwhile; ?>
           </td>
             <td style="width:33%;" align="undefined"
        valign="undefined">
       </tbody>
       </table>
       </div>
       <?php get_footer(); ?>
       ```
   

The topic ‘problem with do not duplicate’ is closed to new replies.

## Tags

 * [do not duplicate](https://wordpress.org/support/topic-tag/do-not-duplicate/)

 * 0 replies
 * 1 participant
 * Last reply from: [andy3000](https://wordpress.org/support/users/andy3000/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/problem-with-do-not-duplicate/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
