Title: PrivatePost   No Duplicates
Last modified: August 19, 2016

---

# PrivatePost No Duplicates

 *  [lethyl](https://wordpress.org/support/users/lethyl/)
 * (@lethyl)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/privatepost-no-duplicates/)
 * Hello everyone, thanks for taking the time to read this issue.
 *     ```
       <?php $query =
       "SELECT post_title,
       MONTH( post_date ) AS month ,
       YEAR( post_date ) AS year,
       DAY( post_date ) AS day ,
       id FROM $wpdb->posts
       WHERE post_status = 'publish' AND post_date <= now( ) and post_type = 'post' ORDER BY post_date DESC";
       if ( $posts = $wpdb->get_results($query) )
       {foreach ($posts as $post) { ?>
   
       <li><span class="archive-date"><?php echo date("F jS, Y",mktime(0, 0, 0, $post->month, $post->day, $post->year)) ?></span> <a href="<?php echo get_permalink($post->id)?>"><?php echo $post->post_title ?></a></li>
   
       <?php } } ?>
       ```
   
 * Here’s the run down of everything:
 * – My website is [http://kristopherlouie.com](http://kristopherlouie.com), the
   afflicted page is [http://kristopherlouie.com/archive](http://kristopherlouie.com/archive)
 * – I’m using [PrivatePost](http://wordpress.org/extend/plugins/privatepost/) to
   allow only registered users to view private entries
 * – I’m using the above code as my archive list.
 * – When you are not logged in, you cannot see any of the private entries on the
   main page or on the archive list.
 * PROBLEM: However, when you are logged in you can see the private entries (intentional)
   but you will also see doubles of each private entry when you view the archives.
 * I’ve tried a lot of loop hacks and editing the query = “” clause, but I can’t
   seem to get it to work.
 * Any feedback would be appreciated.

The topic ‘PrivatePost No Duplicates’ 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: [lethyl](https://wordpress.org/support/users/lethyl/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/privatepost-no-duplicates/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
