Title: [Plugin: TPG Get Posts] Boolean category query
Last modified: August 19, 2016

---

# [Plugin: TPG Get Posts] Boolean category query

 *  Resolved [Sea Jay](https://wordpress.org/support/users/jcollier/)
 * (@jcollier)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-tpg-get-posts-boolean-category-query/)
 * You mentioned that the plugin can select by multiple categories.
 * Could you provide an example of a shortcode formatted to do so, with the results
   including only those posts which contain all the categories?

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

 *  Plugin Author [Criss Swaim](https://wordpress.org/support/users/cswaim/)
 * (@cswaim)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-tpg-get-posts-boolean-category-query/#post-1740601)
 * There are 2 ways to show posts by category
 * 1) by category name
 * `[tpg_get_posts category_name="cat1,cat2"]`
 * 2) by category id
 * `[tpg_get_posts category="2,4,8"]`
 *  Thread Starter [Sea Jay](https://wordpress.org/support/users/jcollier/)
 * (@jcollier)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-tpg-get-posts-boolean-category-query/#post-1740602)
 * Just want to make sure. In 2, will the results include posts that are in ALL 
   the categories (boolean-and) or in ANY one of the three (boolean-or)?
 *  Plugin Author [Criss Swaim](https://wordpress.org/support/users/cswaim/)
 * (@cswaim)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-tpg-get-posts-boolean-category-query/#post-1740603)
 * In both cases, the logic within a single selection group is OR logic. So posts
   that meet any one category is selected. If you list multiple selection tags, 
   ie tags=’xxx’ category=’yyy’, this forms an AND condition.

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

The topic ‘[Plugin: TPG Get Posts] Boolean category query’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/tpg-get-posts_dfefe0.svg)
 * [TPG Get Posts](https://wordpress.org/plugins/tpg-get-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tpg-get-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tpg-get-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/tpg-get-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tpg-get-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tpg-get-posts/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Criss Swaim](https://wordpress.org/support/users/cswaim/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-tpg-get-posts-boolean-category-query/#post-1740603)
 * Status: resolved