Title: Bug with exclude_current
Last modified: August 30, 2016

---

# Bug with exclude_current

 *  Resolved [VATCalculatorPlus](https://wordpress.org/support/users/vatcalculatorplus/)
 * (@vatcalculatorplus)
 * [11 years ago](https://wordpress.org/support/topic/bug-with-exclude_current/)
 * First, thanks for a great plugin! Thought i’d report this bug as a weird kind
   of thank-you!
 * bug – exclude_current sometimes excludes posts when it shouldn’t.
 * I have this shortcode on my home page, in a text widget on the sidebar:
    [display-
   posts exclude_current=”true”]
 * On a fresh install this will exclude the ‘hello world’ post (i guess the home
   page and the hello world post both have the same ID).
 * I think what this needs is a change here:
    // If Exclude Current if( $exclude_current)
   $args[‘post__not_in’] = array( get_the_ID() );
 * maybe add is_single() so exclude_current is only applied on single pages, not
   the home page, searches, archives etc.. ?
 * [https://wordpress.org/plugins/display-posts-shortcode/](https://wordpress.org/plugins/display-posts-shortcode/)

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

 *  Plugin Author [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [11 years ago](https://wordpress.org/support/topic/bug-with-exclude_current/#post-6213465)
 * Good catch! I didn’t think someone would use the exclude_current on a non-single
   post environment like the homepage.
 * I’ve fixed it: [https://github.com/billerickson/display-posts-shortcode/commit/a6718e4e46858f72e59a0a4b656018b2ac8bc062](https://github.com/billerickson/display-posts-shortcode/commit/a6718e4e46858f72e59a0a4b656018b2ac8bc062)
 * This will be included in the next release of the plugin. You can download the
   most up-to-date copy of the plugin here: [https://github.com/billerickson/display-posts-shortcode/archive/master.zip](https://github.com/billerickson/display-posts-shortcode/archive/master.zip)
 *  Thread Starter [VATCalculatorPlus](https://wordpress.org/support/users/vatcalculatorplus/)
 * (@vatcalculatorplus)
 * [11 years ago](https://wordpress.org/support/topic/bug-with-exclude_current/#post-6213476)
 * Fast work Bill!

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

The topic ‘Bug with exclude_current’ is closed to new replies.

 * ![](https://ps.w.org/display-posts-shortcode/assets/icon-256x256.jpg?rev=2940963)
 * [Display Posts - Easy lists, grids, navigation, and more](https://wordpress.org/plugins/display-posts-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/display-posts-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/display-posts-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/display-posts-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/display-posts-shortcode/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [VATCalculatorPlus](https://wordpress.org/support/users/vatcalculatorplus/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/bug-with-exclude_current/#post-6213476)
 * Status: resolved