No Sub-Category Posts in Loops

No Sub-Category Posts in Loops Install Statistics

0
100%
Today: 0 Yesterday: 0 All-time: 5,205 downloads
No Sub-Category Posts in Loops Icon

Try plugin: No Sub-Category Posts in Loops

We'll create fresh WordPress site with No Sub-Category Posts in Loops installed. You have 20 minutes to test the plugin after that site we'll be deleted.

Takes ~10 seconds to install.

About No Sub-Category Posts in Loops

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

3


0


0


0


0

updated: 8 years ago
since: 15 years ago
author: Michael Torbert

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.