近来用WordPress做一个小站,需要象Joomla一样能按Section展示多组分类。下了一个Breukie’s Categories Widget插件达成了这一功能。但当我随后升级到WordPress 2.8的时候,这个插件却不能完好的支持。看了一下源码,原来WordPress 2.8变更了Widgets的实现方法。于是只好自己动手,写了这个增强的Categories Widget插件:Alpha’s Categories Widget。
利用Alpha’s Categories Widget展示多组分类
1. 创建分类

2. 按分组添加Widgets

3. 分组展示效果

下载Alpha’s Categories Widget
Alpha’s Categories Widget | Live demo
Related posts:
- 关闭 WordPress 的缩略图功能 爱上水煮鱼的猫编译了一篇《WordPress Hack 技巧》,其中提到: Tip 8:关闭 WordPress 的缩略图功能(替代方法) 当你上传一张图片到 WordPress 的时候,它会创建两张额外的缩略图,我不知道怎么在...
- CakePHP 实例教程: Categories Acts as Tree Tree是CakePHP 1.2的核心Behaviors之一,可以用来轻易的实现无限极分类,并呈现树状列表。 图片来源:Tree traversa,WIKIPEDIA 基础实例 建立数据表 CREATE TABLE `categories` (...
- cakephp controller中设置viewVars时的陷阱 要从controller传递变量到view,需要使用set method。基本的用法是 $this->set('categories',$categories); 更顺手的写法是 $this->set(compact('categories')); 多个变量时可以这样写 $this->set('categories',$categories); $this->set('category',$category);...
{ 6 comments… read them below or add one }
Nice plugin. Just what I’m looking for in terms of being able to easily define and maintain multiple category widgets. Wonderful! Thanks!!
But can you explain how I can use term_group to set the sort order? I’ve done some search around and can’t find much anywhere. Even the WP.org site is vagoe on the subject.
I like the plugin a lot but if I could also custom order how the categories are listed then I’d be in heaven!!!
一会改改,我也写一篇去
Very good plugin ! Just what i was looking for…
I have some questions : how can I insert the category list buttons (as it is by default in wordpress) and can I personalise each image below the names of the group of categories (the sidebars h2 background in css file) ?
Kaham´s last blog ..Assassin’s Creed Lineage
I like the ‘Alpha’s Categories Widget’ plugin, however I am not able to exclude certain categories in the list.
I want to exclude ?cat=23 en ?cat=23 from the list. I tried filling in 23,24 and the titles as well, but that did not do the trick.
How can I exclude pages from the list with this widget?
Thank you,
Arend
Muzik, thank you for creating this. Exactly what I was looking for.
I found one problem though and was able to correct it. Your category count sort does not work properly. You need to specify a ksort type.
Adding the SORT_NUMERIC option to the ksort function in your code fixed my problem. I can’t understand 99% of the rest of your code… but I got lucky somehow. : )
}
ksort($new,SORT_NUMERIC);
return array_values($new);
}
?>
Hi,
This plugin is very good, but I found one problem, the option ‘child_of’ don’t work when we specific zero, because in line 251 in function ‘get_alpha_categories’ the comparation is do if($child_of). Then “0″ is equals false, then i add if($child_of !== false && $child_of !== “”).
Tks,
Richard