Title: Can &#8220;WordPress Posts&#8221; skip current post?
Last modified: February 13, 2017

---

# Can “WordPress Posts” skip current post?

 *  Resolved [Theo](https://wordpress.org/support/users/dubeux/)
 * (@dubeux)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/)
 * I’m using the “WordPress Posts” particle [on this page](https://portaodoser.com.br/2016/12/fazenda-campo-verde/)(
   at the bottom, just before footer). Is it possible for it to avoid listing the
   current post?
    -  This topic was modified 9 years, 3 months ago by [Theo](https://wordpress.org/support/users/dubeux/).

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

 *  Plugin Author [Gantry](https://wordpress.org/support/users/gantry/)
 * (@gantry)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/#post-8969195)
 * Hi,
 * I’m very sorry for late reply. Do you still need support with this topic?
 * Thanks,
    Jakub
 *  Thread Starter [Theo](https://wordpress.org/support/users/dubeux/)
 * (@dubeux)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/#post-9178025)
 * Hi,
    I’m the one to apologize – for some reason I haven’t noticed this reply.
   Yes, I still have that issue. If someone can point me the direction to solve 
   it, I’d be very grateful.
 *  Plugin Author [Gantry](https://wordpress.org/support/users/gantry/)
 * (@gantry)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/#post-9189496)
 * What do you mean by current post? You’d need to define which one is “first” for
   you. The newest one in choosen category?
 *  Thread Starter [Theo](https://wordpress.org/support/users/dubeux/)
 * (@dubeux)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/#post-9190723)
 * This page is actually a post, called _Fazenda Campo Verde_. The _WordPress Posts_
   particle, at the bottom, list other posts, but repeats this one. Is there a way
   for the particle to exclude the current post from it?
 *  Plugin Author [Gantry](https://wordpress.org/support/users/gantry/)
 * (@gantry)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/#post-9191029)
 * Yes, there is, but it requires modifying WordPress posts particle. I’m currently
   out of my hometown but if you’ll wait till monday I’m gonna prepare a code for
   you.
 * Sounds good?
 *  Thread Starter [Theo](https://wordpress.org/support/users/dubeux/)
 * (@dubeux)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/#post-9191679)
 * Sounds no less than amazing, thanks a lot.
 *  Plugin Author [Gantry](https://wordpress.org/support/users/gantry/)
 * (@gantry)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/#post-9202247)
 * Allright, here is the code that I promised 🙂 Firstly you have to copy the `wp-
   content/plugins/gantry5/engines/wordpress/nucleus/particles/contentarray.html.
   twig` to the `wp-content/themes/g5_helium/custom/particles/`
 * Next step is to edit that TWIG file and replace this code :
 *     ```
          {# Query Posts #}
           {% set query_parameters = {
               'cat': filter.categories|replace(' ', ','),
               'posts_per_page': limit.total|default('-1'),
               'offset': limit.start|default('0'),
               'orderby': sort.orderby,
               'order': sort.ordering,
               'ignore_sticky_posts': sticky_posts
           } %}
       ```
   
 * with this :
 *     ```
          {# Query Posts #}
           {% set current_post = [wordpress.call('Timber::get_post').ID] %}
           {% set query_parameters = {
               'cat': filter.categories|replace(' ', ','),
               'posts_per_page': limit.total|default('-1'),
               'offset': limit.start|default('0'),
               'orderby': sort.orderby,
               'order': sort.ordering,
               'ignore_sticky_posts': sticky_posts,
               'post__not_in': current_post
           } %}
       ```
   
 * This should ignore the current post.
    -  This reply was modified 8 years, 11 months ago by [Gantry](https://wordpress.org/support/users/gantry/).
 *  Thread Starter [Theo](https://wordpress.org/support/users/dubeux/)
 * (@dubeux)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/#post-9202617)
 * Worked like a charm, thank you very very much.
    . In case someone else looks 
   for this, in my (hydrogen theme) install, the original twig file was here: `wp-
   content/plugins/gantry5/engines/wordpress/nucleus/particles/contentarray.html.
   twig` And I’ve copied it to my child theme: `wp-content/themes/child-theme/custom/
   particles/contentarray.html.twig` . Thanks again, that was really helpful.

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

The topic ‘Can “WordPress Posts” skip current post?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gantry5_86a2c3.svg)
 * [Gantry 5 Framework](https://wordpress.org/plugins/gantry5/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gantry5/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gantry5/)
 * [Active Topics](https://wordpress.org/support/plugin/gantry5/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gantry5/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gantry5/reviews/)

## Tags

 * [Wordpress Posts](https://wordpress.org/support/topic-tag/wordpress-posts/)

 * 8 replies
 * 2 participants
 * Last reply from: [Theo](https://wordpress.org/support/users/dubeux/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/can-wordpress-posts-skip-current-post/#post-9202617)
 * Status: resolved