修改WordPress标签云的字体大小以及显示数量

wp-includes/category-template.php,打开并搜索wp_tag_cloud,这个就是标签云的调用函数了,查了一下参数表,得到wp_tag_cloud函数的参数如下:

smallest – Adjusts the size of the smallest tags in the cloud. Default is “8″.
largest – Adjusts the size of the biggest tags in the cloud. Default is “22″.
unit – Sets the unit type for font size (ie point or em). Default is “pt”.
number – How many tags will display in the cloud. Default is “45″.
format – “Flat” displays an inline cloud with each term separated by whitespace. “List” generates an unordered list. “Array” lets you define an array of tags. Default is “flat”.
orderby – Sort the cloud by “name” or “count”. Default is “name”.
order – Sort the cloud in ascending or descending order. Default is “ASC”.

对照修改即可,其中:

unit=是字体大小的单位,使用我们熟悉的px最好;

smallest=是指最小字体大小,自己修改;

largest=是指最大字体大小,自己修改。

还可以使用number=来设置标签的显示数量,orderby=来使得标签云按照标签的使用次数来排列等等。

0 0 投票数
文章评分
订阅评论
提醒
guest

11 评论
最旧
最新 最多投票
内联反馈
查看所有评论
万戈
2009年11月19日 12:58

我已经不敢再改WP文件了,升级太麻烦

Louis Han
2009年11月20日 00:37

我都懒得搭理标签云了

集团电话
2009年11月20日 13:16

记得上学时学了一段时间VB,后来学贸易时都是大写英文字母,导致现在一看英文就崩溃!

搓板
2009年11月20日 20:07

标签云 我从来都不管。

Hobo
2009年11月21日 11:13

呵呵方便更改了,不过我一直是用默认的

小搓板
2009年11月22日 11:07

再次来访.

Zenoven自由人
2009年11月24日 17:57

我记得我开始改的时候没成功 最后好像改了定义吧。。。具体忘了

安啦网
2010年12月23日 09:44

学习了,已用上

任刚的博客
2011年2月3日 19:48

我遇到的问题是像个标签云加上一个alt属性 比如一个叫 美术的标签 我给他加上 title 和 alt
这个在哪儿修改呢?

11
0
希望看到您的想法,请您发表评论x