Title: Exclude posts (like events, galleries)?
Last modified: August 30, 2016

---

# Exclude posts (like events, galleries)?

 *  Resolved [begeester](https://wordpress.org/support/users/begeester/)
 * (@begeester)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/)
 * Hi,
    Is it possible to exclude certain posts? I have this website on which I 
   want to display the author box on blog pages, but not on my event and gallery
   pages. I can’t seem to change this in the setting.
 * Cheers,
 * Leonard
 * [https://wordpress.org/plugins/birds-author-box/](https://wordpress.org/plugins/birds-author-box/)

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

 *  Plugin Author [Frederic Serva](https://wordpress.org/support/users/fredserva/)
 * (@fredserva)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295213)
 * Do your event & gallery posts belong to categories named ‘event’ and ‘gallery’?
   
   If so, you can exclude these categories:
 * Open **frontend.php** (in ‘Public’ folder)
    Find line 94
 * > if ((!is_singular($custpt) && !in_array(‘woocommerce-page’, $bodyclasses)))
 * and add just after **$bodyclasses)** (mind the bracket!)
 * > && !in_category( array( ‘event’, ‘gallery’) )
 * Save the file.
    Done!
 *  Plugin Author [Frederic Serva](https://wordpress.org/support/users/fredserva/)
 * (@fredserva)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295214)
 * If these are Pages ([Read that post](http://www.wpbeginner.com/beginners-guide/what-is-the-difference-between-posts-vs-pages-in-wordpress/))
 * add
 * > !is_page( array( ‘event’, ‘gallery’ ) )
 *  Thread Starter [begeester](https://wordpress.org/support/users/begeester/)
 * (@begeester)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295299)
 * Thank you very much! One more question if I may, How do I exclude posts in child
   categories? This doesn’t seem to work with just using the names of the categories.
 *  Plugin Author [Frederic Serva](https://wordpress.org/support/users/fredserva/)
 * (@fredserva)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295306)
 * Take a look at the [Codex](https://codex.wordpress.org/Function_Reference/in_category#Testing_if_a_post_is_in_a_descendant_category)
 * It should work with names of any category.
 *  [kinokas7](https://wordpress.org/support/users/kinokas7/)
 * (@kinokas7)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295381)
 * Hi Frederic
    Thanks for your contribution on those great Birds plugins and themes.
   I use Author Box and came up with similar problem where it runs flawlessly across
   my site but there is time I want to disable it on some static pages, found this
   thread and your tweak in frontend.php, let me just chime-in : !is_page( array(‘
   event’, ‘gallery’ ) ) The above line does NOT work, for those who want it disabled
   on some pages. I pasted that code right in line 94 and saved frontend.php, refreshed
   web, got error message saying “unexpected ! causing error in line 94”.
 * Then I figured out the solution, you forgot the &&, paste the code below right
   after $bodyclasses),change page title accordingly to your site :
    && !is_page(
   array(‘about’,’service’,’contact’)) That should work on pages. Cheers and keep
   up the good works, I got another question below.
 *  [kinokas7](https://wordpress.org/support/users/kinokas7/)
 * (@kinokas7)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295382)
 * Did you test Author Box on any Visual Composer module-built pages and default
   WordPress template pages? For my site, Author Box works perfectly with VC built
   pages, the Bio/Social/Latest Posts tabs displays correct, however, when using
   a WP default template pages, Author Box tabs shows little black pixel-like squares
   in tab-titles. Very weird. When I switched that page to VC built landing page,
   Author Box tabs just shows the title without those black little squares.
    There
   might still be time I want to use Author Box on default template pages, so any
   solutions? Thanks in advance.
 * Yun
 *  [kinokas7](https://wordpress.org/support/users/kinokas7/)
 * (@kinokas7)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295383)
 * Oh, 2nd Question : How can I add popular Chinese social network Weibo in the 
   php file?
    Or could you add Chinese social icons in the next update? Cheers.
 *  Plugin Author [Frederic Serva](https://wordpress.org/support/users/fredserva/)
 * (@fredserva)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295387)
 * 1st question:
    CSS conflict somewhere…
 * 2nd question:
    I’ll think about it 🙂
 *  [Ged1m1nas](https://wordpress.org/support/users/ged1m1nas/)
 * (@ged1m1nas)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295407)
 * Hello,
 * is it possible to exclude plugin in portfolio galleries, i have tried on my website
   like you have been written above – for me doesn’t work.
 * [http://www.gediminasgrazys.lt/portfolio/vestuves/](http://www.gediminasgrazys.lt/portfolio/vestuves/)
 * Thank you for advice.
 * G.G
 *  Plugin Author [Frederic Serva](https://wordpress.org/support/users/fredserva/)
 * (@fredserva)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295408)
 * I suppose that your portfolio items are custom post types.
    So: open **frontend.
   php** (in ‘Public’ folder). Find line 92 Add a new line after this one and write:
 * > ‘portfolio’,
 * (Mind the comma)
    Save.

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

The topic ‘Exclude posts (like events, galleries)?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/birds-author-box_46ad99.svg)
 * [Birds Author Box](https://wordpress.org/plugins/birds-author-box/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/birds-author-box/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/birds-author-box/)
 * [Active Topics](https://wordpress.org/support/plugin/birds-author-box/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/birds-author-box/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/birds-author-box/reviews/)

 * 10 replies
 * 4 participants
 * Last reply from: [Frederic Serva](https://wordpress.org/support/users/fredserva/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/exclude-posts-like-events-galleries/#post-6295408)
 * Status: resolved