Title: Remove single post from query
Last modified: August 19, 2016

---

# Remove single post from query

 *  [cjhmdm](https://wordpress.org/support/users/cjhmdm/)
 * (@cjhmdm)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/remove-single-post-from-query/)
 * Hello, I have 2 queries on my single post page (single.php). My first query shows
   the full post for the article clicked, the second query shows the 3 latest posts
   in excerpt format, which happens to include the actual post being displayed.
 * I’m using arras theme, and the double query is required, what I’m wondering is,
   is there a way to show the latest 3 posts in query 2 _except_ for the full post
   being shown on that page?
 * Since I suck at explaining, here’s an example:
 * mydomain/posts/newest
    mydomain/posts/2nd_newest mydomain/posts/3rd_newest mydomain/
   posts/4th_newest
 * When mydomain/posts/newest is viewed, query 2 shows 2nd_newest, 3rd_newest and
   4th_newest
 * When mydomain/posts/2nd_newest is viewed, query 2 shows newest, 3rd_newest and
   4th_newest
 * When mydomain/posts/3rd_newest is viewed, query 2 shows newest, 2nd_newest and
   4th_newest
 * And so on and so forth.
 * Is something like this possible? Thanks in advance for any enlightnement 🙂

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/remove-single-post-from-query/#post-1295535)
 * Before you first loop, the loop that displays the single post, put
 *     ```
       $nodup=array();
       ```
   
 * and inside that first loop put:
 *     ```
       $nodup[]=$post->ID;
       ```
   
 * Then for your 2nd query something like:
 *     ```
       $args=array(
         'post__not_in' => array($nodup),
         'showposts'=>3,
         'caller_get_posts'=>1
       );
       $my_query = new WP_Query($args);
       ```
   
 *  [Maxaud](https://wordpress.org/support/users/maxaud/)
 * (@maxaud)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/remove-single-post-from-query/#post-1295674)
 * pretty useful code.

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

The topic ‘Remove single post from query’ is closed to new replies.

## Tags

 * [displaying](https://wordpress.org/support/topic-tag/displaying/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [single](https://wordpress.org/support/topic-tag/single/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Maxaud](https://wordpress.org/support/users/maxaud/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/remove-single-post-from-query/#post-1295674)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
