plugin-icon

No Sub-Category Posts in Loops

제작자: Glenn Ansley·
Once activated, only posts from the current category are displayed in your loop (no posts from sub cats).
등급
5/5
버전
0.4
활성화된 설치 항목
100
최근 업데이트일
Nov 19, 2015

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.

무료Business 요금제에서
설치하면 WordPress.com 서비스 약관서드파티 플러그인 약관에 동의하게 됩니다.
테스트된 버전
WordPress 4.4.34
이 플러그인은 다운로드할 수 있으며 에서 사용할 수 있습니다.