No Sub-Category Posts in Loops

Once activated, only posts from the current category are displayed in your loop (no posts from sub cats).

Author:Michael Torbert (profile at wordpress.org)
WordPress version required:3.1
WordPress version tested:4.4
Plugin version:0.4
Added to WordPress repository:30-01-2009
Last updated:19-11-2015
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:100
Rated by:3
Plugin URI:http://fullthrottledevelopment.com/no-sub-cat...
Total downloads:5 227
Active installs:100+
plugin download
Click to start download

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.


FAQ
ChangeLog