Linux 软件免费装

No Sub-Category Posts in Loops

开发者 hallsofmontezuma
fullthrottledevelopment
blepoxp
更新时间 2015年11月20日 07:31
捐献地址: 去捐款
PHP版本: 2.7 及以上
WordPress版本: 3.1

标签

posts categories loop cats

下载

0.1 0.2 0.3 0.4

详情介绍:

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.

安装:

  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

升级注意事项:

Fixed bug introduced with WordPress 3.1. Added inline docs. Removed filter after main query is built.

常见问题:

Where can I find help or make suggestions?

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

更新日志: