首页 > WordPress > wordpress自带标签云设置

wordpress自带标签云设置

2008年11月29日 发表评论 阅读评论

总觉得标签云有些怪怪的,感觉使用标签不止这么多,而且最大的字体有些大了。于是乎发动懒猫精神上网搜索了下,这一刻搜索引擎是强大的 :grin:

SlyarSlyar的blog上看到相关的一篇文章修改WordPress标签云的字体大小以及显示数量修改WordPress标签云的字体大小以及显示数量介绍到标签云的一系列参数,顺便也转录过来了:

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 (i.e. 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”.

把参数值写入\wp-includes\widgets.php中的wp_tag_cloud()函数中即可,例如:

1
wp_tag_cloud('unit=px&smallest=12&largest=20&number=50&orderby=count');

即把标签云设置成最大字体20像素,最小字体12像素,显示数目50,按照使用次数排序

分类: WordPress 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.