Title: Exclude only a page
Last modified: August 30, 2016

---

# Exclude only a page

 *  Resolved [renardchan](https://wordpress.org/support/users/renardchan/)
 * (@renardchan)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/exclude-only-a-page/)
 * Hi,
 * I would like to exclude masonry on gallery only on a page. I found this topic
   [https://wordpress.org/support/topic/exclude-some-galleries?replies=5](https://wordpress.org/support/topic/exclude-some-galleries?replies=5)
   
   but didn’t find the line if( has_shortcode( $post->post_content, ‘gallery’) ){
 * Is there an another way to exclude a page?
 * [https://wordpress.org/plugins/jquery-masonry-image-gallery/](https://wordpress.org/plugins/jquery-masonry-image-gallery/)
 * Thanks,
    Regards

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

 *  Plugin Author [phoenixMagoo](https://wordpress.org/support/users/phoenixmagoo/)
 * (@phoenixmagoo)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/exclude-only-a-page/#post-6579476)
 * Hey! That’s actually the way to do it, BUT I removed that line of code with the
   last update since so many people have started using meta fields. You can add 
   it back in if you want and change it from:
 * `if( has_shortcode( $post->post_content, 'gallery') ) {`
 * to
 * `if( is_page(YOUR PAGE ID) ) {`
 * Just change YOUR PAGE ID to correct ID.
 * If you need more help than that, let me know. I can probably whip up a custom
   build for you, but it wouldn’t be until the weekend.
 * Thanks!
 *  [Alex333](https://wordpress.org/support/users/alex333/)
 * (@alex333)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-only-a-page/#post-6579747)
 * Hi!
 * Could you explain, which code should I insert in three-dot-nine.php in order 
   to exclude a page.
 * Thanks!
 *  Plugin Author [phoenixMagoo](https://wordpress.org/support/users/phoenixmagoo/)
 * (@phoenixmagoo)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-only-a-page/#post-6579748)
 * Sure! To exclude a page:
 * `if( has_shortcode( $post->post_content, 'gallery') ) {`
 * to
 * `if( !is_page(YOUR PAGE ID) ) {`
 * If you need more help than that, let me know. I can probably whip up a custom
   gist for you today.
 * Thanks!
 *  [Alex333](https://wordpress.org/support/users/alex333/)
 * (@alex333)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-only-a-page/#post-6579749)
 * Hi Phoenix!
 * I can’t find “if( has_shortcode( $post->post_content, ‘gallery’) ) {” in three-
   dot-nine.php file..
 *  Plugin Author [phoenixMagoo](https://wordpress.org/support/users/phoenixmagoo/)
 * (@phoenixmagoo)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-only-a-page/#post-6579750)
 * [Here is a gist I made for you](https://gist.github.com/phoenixMag00/9c704708d55659956263).
   You need to change YOURPAGEIDHERE to the correct ID for the excluded page.
 * Let me know how it works.
 * Good luck!
 *  [Alex333](https://wordpress.org/support/users/alex333/)
 * (@alex333)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-only-a-page/#post-6579751)
 * Yes, it works!
    And is it possible to add two or more IDs?
 *  Plugin Author [phoenixMagoo](https://wordpress.org/support/users/phoenixmagoo/)
 * (@phoenixmagoo)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-only-a-page/#post-6579752)
 * I updated the gist. just add more comma separated page IDs.
 * Thanks!
 *  [Alex333](https://wordpress.org/support/users/alex333/)
 * (@alex333)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-only-a-page/#post-6579753)
 * Thanks a lot and have a nice day!!

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

The topic ‘Exclude only a page’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jquery-masonry-image-gallery_aa9c85.
   svg)
 * [jQuery Masonry Image Gallery](https://wordpress.org/plugins/jquery-masonry-image-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jquery-masonry-image-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jquery-masonry-image-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/jquery-masonry-image-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jquery-masonry-image-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jquery-masonry-image-gallery/reviews/)

## Tags

 * [exclude](https://wordpress.org/support/topic-tag/exclude/)

 * 8 replies
 * 3 participants
 * Last reply from: [Alex333](https://wordpress.org/support/users/alex333/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-only-a-page/#post-6579753)
 * Status: resolved