Title: dinamically excluding current post
Last modified: September 1, 2016

---

# dinamically excluding current post

 *  Resolved [mrenrich](https://wordpress.org/support/users/mrenrich/)
 * (@mrenrich)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/dinamically-excluding-current-post/)
 * Hi, I am using PHP function in_category() to show posts through the post grid
   plugin, for example I am reading post id 1, at the end of the post I did put 
   a new grid about related posts of a given category.
    Is it possible to exclude
   the current post ID ?
 * `<?php if(in_category('27')){ ?><?php echo do_shortcode( '[the-post-grid id="
   560" title="inside_post"]' ) ?><?php }?>`
 * I thought i could extract ID post before but how to get it works within the post
   grid ?
 * Thanks
 * [https://wordpress.org/plugins/the-post-grid/](https://wordpress.org/plugins/the-post-grid/)

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

 *  Plugin Author [RadiusTheme](https://wordpress.org/support/users/techlabpro1/)
 * (@techlabpro1)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/dinamically-excluding-current-post/#post-7591951)
 * Hello,
 * For this you need custom query and css. I think it will not work but you can 
   try custom query.
 * Thanks
 *  Thread Starter [mrenrich](https://wordpress.org/support/users/mrenrich/)
 * (@mrenrich)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/dinamically-excluding-current-post/#post-7591971)
 * I can try…but the main problem is to mix it with your shortcode.
 * Any help?
 *  Plugin Author [RadiusTheme](https://wordpress.org/support/users/techlabpro1/)
 * (@techlabpro1)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/dinamically-excluding-current-post/#post-7591982)
 * Hello,
    My plugin coding structure in object oriented I think using this code
   you can not show others post.
 * Better you can code your own Query and to display can use my coding structure
   then you get same look as my plugin.
 * I can send you the query if you want?
 * Thanks
 *  Plugin Author [RadiusTheme](https://wordpress.org/support/users/techlabpro1/)
 * (@techlabpro1)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/dinamically-excluding-current-post/#post-7592025)
 * Hi,
 * I am closing this topic. If need any more help please let me know.
 * Thanks

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

The topic ‘dinamically excluding current post’ is closed to new replies.

 * ![](https://ps.w.org/the-post-grid/assets/icon-256x256.gif?rev=2647621)
 * [The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid](https://wordpress.org/plugins/the-post-grid/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-post-grid/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-post-grid/)
 * [Active Topics](https://wordpress.org/support/plugin/the-post-grid/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-post-grid/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-post-grid/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [RadiusTheme](https://wordpress.org/support/users/techlabpro1/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/dinamically-excluding-current-post/#post-7592025)
 * Status: resolved