Title: No Sub-Category Posts in Loops
Author: Glenn Ansley
Published: <strong>Gener 30, 2009</strong>
Last modified: Novembre 19, 2015

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/no-sub-category-posts-in-loop.svg)

# No Sub-Category Posts in Loops

 By [Glenn Ansley](https://profiles.wordpress.org/blepoxp/)

[Download](https://downloads.wordpress.org/plugin/no-sub-category-posts-in-loop.zip)

 * [Details](https://bal.wordpress.org/plugins/no-sub-category-posts-in-loop/#description)
 * [Reviews](https://bal.wordpress.org/plugins/no-sub-category-posts-in-loop/#reviews)
 *  [Installation](https://bal.wordpress.org/plugins/no-sub-category-posts-in-loop/#installation)
 * [Development](https://bal.wordpress.org/plugins/no-sub-category-posts-in-loop/#developers)

 [Support](https://wordpress.org/support/plugin/no-sub-category-posts-in-loop/)

## Description

Once activated, only posts from the current category are displayed in your loop (
no posts from sub cats).
 That’s all it does. No options. If you find you need options,
let me know and I’ll build them into it.

As of 0.4 I remove the filter after the main query is built so that it doesn’t interfere
with widgets.
 If you have a custom query or call wp_query on a category archive
template, you’ll need to add and remove the filters before and after your query.
Below is an example of how to do this if you use wp_query. Again, this is not necessary
unless you have modified queries in a template file.

    ```
    add_filter( 'posts_where', 'ft_nscp_mod_where' );
    query_posts( array( 'your-custom' => 'args' ) );
    remove_filter( 'posts_where', 'ft_nscp_mod_where' );
    ```

Its important that you remove what you add.

## Installation

 1. Upload the directory “ft-no-subcats-in-loop” to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## FAQ

  Where can I find help or make suggestions?

http://fullthrottledevelopment.com/no-sub-category-posts-in-loop

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“No Sub-Category Posts in Loops” is open source software. The following people have
contributed to this plugin.

Contributors

 *   [ Glenn Ansley ](https://profiles.wordpress.org/blepoxp/)
 *   [ Michael Torbert ](https://profiles.wordpress.org/hallsofmontezuma/)

[Translate “No Sub-Category Posts in Loops” into your language.](https://translate.wordpress.org/projects/wp-plugins/no-sub-category-posts-in-loop)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/no-sub-category-posts-in-loop/),
check out the [SVN repository](https://plugins.svn.wordpress.org/no-sub-category-posts-in-loop/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/no-sub-category-posts-in-loop/)
by [RSS](https://plugins.trac.wordpress.org/log/no-sub-category-posts-in-loop/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

 * 0.5 – Fixed bug that broke plugin in 3.1. Props @ollybenson (http://gln.to/oshcw)
 * 0.4 – Fixed bug introduced with WordPress 3.1. Added inline docs. Removed filter
   after main query is built.
 * 0.3 – Modified directory structure so that plugin may be added and activated 
   from wp-admin
 * 0.2 – Forgot to define a global, preventing posts from appearing that should.(
   thanks to http://redfootwebdesign.com for the heads up!)
 * 0.1 – Original release.

## Meta

 *  Version **0.4**
 *  Last updated **10 anys ago**
 *  Active installations **100+**
 *  WordPress version ** 3.1 or higher **
 *  Tested up to **4.4.34**
 *  Language
 * [English (US)](https://wordpress.org/plugins/no-sub-category-posts-in-loop/)
 * Tags
 * [categories](https://bal.wordpress.org/plugins/tags/categories/)[cats](https://bal.wordpress.org/plugins/tags/cats/)
   [loop](https://bal.wordpress.org/plugins/tags/loop/)[posts](https://bal.wordpress.org/plugins/tags/posts/)
 *  [Advanced View](https://bal.wordpress.org/plugins/no-sub-category-posts-in-loop/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  3 5-star reviews     ](https://wordpress.org/support/plugin/no-sub-category-posts-in-loop/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/no-sub-category-posts-in-loop/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/no-sub-category-posts-in-loop/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/no-sub-category-posts-in-loop/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/no-sub-category-posts-in-loop/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/no-sub-category-posts-in-loop/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/no-sub-category-posts-in-loop/reviews/)

## Contributors

 *   [ Glenn Ansley ](https://profiles.wordpress.org/blepoxp/)
 *   [ Michael Torbert ](https://profiles.wordpress.org/hallsofmontezuma/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/no-sub-category-posts-in-loop/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8)