Title: Exclude the current post in the get posts code
Last modified: August 19, 2016

---

# Exclude the current post in the get posts code

 *  [daand](https://wordpress.org/support/users/daand/)
 * (@daand)
 * [16 years ago](https://wordpress.org/support/topic/exclude-the-current-post-in-the-get-posts-code/)
 * What if i want to exclude the current post in the get posts code?
 * $postslist = get_posts(‘numberposts=1000&order=ASC&exclude=….&orderby=date&cat
   =’ . $cat_id);
 * In which case … should be the current post ID.
 * The current post ID template tag is; the_ID() I thought.
 * I would very much appericiate it when someone could explain how it works, because
   i dont want to bother you every time..
 * Thanks in advance!
    Daan

The topic ‘Exclude the current post in the get posts code’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [daand](https://wordpress.org/support/users/daand/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/exclude-the-current-post-in-the-get-posts-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
