<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: 不用任何插件实现 WordPress 的彩色标签云</title> <atom:link href="http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/feed/" rel="self" type="application/rss+xml" /><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/</link> <description>走点路，走自己牛逼的路，让那些个傻逼去说吧！</description> <lastBuildDate>Thu, 29 Jul 2010 15:11:12 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0</generator> <item><title>By: 摩凝(M.Chan)</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15826</link> <dc:creator>摩凝(M.Chan)</dc:creator> <pubDate>Wed, 21 Jul 2010 11:36:32 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15826</guid> <description>非常有用，谢谢分享^_^</description> <content:encoded><![CDATA[<p>非常有用，谢谢分享^_^</p> ]]></content:encoded> </item> <item><title>By: 依水居</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15652</link> <dc:creator>依水居</dc:creator> <pubDate>Mon, 05 Jul 2010 16:00:48 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15652</guid> <description>搞出了乱码。。。杯具啊。。 :evil:</description> <content:encoded><![CDATA[<p>搞出了乱码。。。</p><p>杯具啊。。 <img src='//showfom.imgbed.com/style/img/smilies/icon_evil.gif' alt=':evil:' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: 不用任何插件实现 WordPress 彩色标签云 - WordPress_阿七实验室</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15624</link> <dc:creator>不用任何插件实现 WordPress 彩色标签云 - WordPress_阿七实验室</dc:creator> <pubDate>Sat, 03 Jul 2010 18:07:36 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15624</guid> <description>[...] WordPress database error: [Duplicate entry &#039;post-410&#039; for key 1] INSERT INTO wp_postviewsplus (count_type, count_id, look_ip, look_ip_time) VALUES (&quot;post&quot;, &quot;410&quot;, &quot;&quot;, &quot;1278191256&quot;) /* *//*]]&gt;*/ 不用任何插件实现 WordPress 彩色标签云Posted by 阿七 on 六月 12th, 2010 12人围观阿七说：近日看到很多朋友的blog标签云都是五颜六色的，非常绚丽，于是也想借来用用，忽一日在showfom的blog上看到了这篇文章，拿来转载。以下多为转载，鲜有自写。侧边栏的标签云（Tag Cloud）一直是 WordPress 2.3+ 以后的内置功能，一般直接调用函数 wp_tag_cloud 或者在 Widgets 里开启即可，但是默认的全部是一个颜色，只是大小不一样，很是不顺眼，虽然可以用 Simple Tags 之类的插件，但是总感觉不爽，所以我介绍一个不用任何插件就能显示彩色标签云的方法。方法是 Alex 的英文站那里看来的，直接拿来主义和大家分享之。【此为本文作者原话，我是从showfom的博客里看到的】PS：貌似是冰古兄弟原创。后台编辑主题的 functions.php , 输入以下代码function colorCloud($text) { $text = preg_replace_callback(&#039;&#124;&lt;a (.+?)&gt;&#124;i&#039;, &#039;colorCloudCallback&#039;, $text); return $text; } function colorCloudCallback($matches) { $text = $matches[1]; $color = dechex(rand(0,16777215)); $pattern = &#039;/style=(&#039;&#124;&quot;)(.*)(&#039;&#124;&quot;)/i&#039;; $text = preg_replace($pattern, &quot;style=&quot;color:#{$color};$2;&quot;&quot;, $text); return &quot;&lt;a $text&gt;&quot;; } add_filter(&#039;wp_tag_cloud&#039;, &#039;colorCloud&#039;, 1);可以看到，颜色是随机的，可以自行修改 $color = dechex(rand(0,16777215));  这行来修改范围，这样就很炫耀哈哈。然后在侧边栏 sidebar.php 里调用如下代码：&lt;?php wp_tag_cloud(&#039;smallest=8&amp;largest=24&amp;number=50&#039;); ?&gt;即可，8 是最小的 tag 的字体大小（用的最少的 tag），24 是最大的（用的最多的 tag），50 是 tag 的数目，可以自行修改。假如你是个主题高手，直接集成在主题里那一定很帅！效果可以看本文右边侧边栏的标签栏：本站背景现为白色，可能有些刺眼。  标签：Wordpress, 标签云  &#171; 搜索故事会：SEW和Donews 谷歌说：图片描述 &#187;  萧涵2010-06-13,2:54 上午  不错的方法，谢谢分享[回复] 赵实丰的文摘2010-07-01,10:17 下午  [...] 不用任何插件实现 WordPress 彩色标签云 &#8211; 建站实验室_阿七实验室. [...]访客留言 [...]</description> <content:encoded><![CDATA[<p>[...] WordPress database error: [Duplicate entry &#39;post-410&#39; for key 1] INSERT INTO wp_postviewsplus (count_type, count_id, look_ip, look_ip_time) VALUES (&quot;post&quot;, &quot;410&quot;, &quot;&quot;, &quot;1278191256&quot;) /* *//*]]&gt;*/ 不用任何插件实现 WordPress 彩色标签云Posted by 阿七 on 六月 12th, 2010 12人围观阿七说：近日看到很多朋友的blog标签云都是五颜六色的，非常绚丽，于是也想借来用用，忽一日在showfom的blog上看到了这篇文章，拿来转载。以下多为转载，鲜有自写。侧边栏的标签云（Tag Cloud）一直是 WordPress 2.3+ 以后的内置功能，一般直接调用函数 wp_tag_cloud 或者在 Widgets 里开启即可，但是默认的全部是一个颜色，只是大小不一样，很是不顺眼，虽然可以用 Simple Tags 之类的插件，但是总感觉不爽，所以我介绍一个不用任何插件就能显示彩色标签云的方法。方法是 Alex 的英文站那里看来的，直接拿来主义和大家分享之。【此为本文作者原话，我是从showfom的博客里看到的】PS：貌似是冰古兄弟原创。后台编辑主题的 functions.php , 输入以下代码function colorCloud($text) { $text = preg_replace_callback(&#39;|&lt;a (.+?)&gt;|i&#39;, &#39;colorCloudCallback&#39;, $text); return $text; } function colorCloudCallback($matches) { $text = $matches[1]; $color = dechex(rand(0,16777215)); $pattern = &#39;/style=(&#39;|&quot;)(.*)(&#39;|&quot;)/i&#39;; $text = preg_replace($pattern, &quot;style=&quot;color:#{$color};$2;&quot;&quot;, $text); return &quot;&lt;a $text&gt;&quot;; } add_filter(&#39;wp_tag_cloud&#39;, &#39;colorCloud&#39;, 1);可以看到，颜色是随机的，可以自行修改 $color = dechex(rand(0,16777215));  这行来修改范围，这样就很炫耀哈哈。然后在侧边栏 sidebar.php 里调用如下代码：&lt;?php wp_tag_cloud(&#39;smallest=8&amp;largest=24&amp;number=50&#39;); ?&gt;即可，8 是最小的 tag 的字体大小（用的最少的 tag），24 是最大的（用的最多的 tag），50 是 tag 的数目，可以自行修改。假如你是个主题高手，直接集成在主题里那一定很帅！效果可以看本文右边侧边栏的标签栏：本站背景现为白色，可能有些刺眼。  标签：WordPress, 标签云  &laquo; 搜索故事会：SEW和Donews 谷歌说：图片描述 &raquo;  萧涵2010-06-13,2:54 上午  不错的方法，谢谢分享[回复] 赵实丰的文摘2010-07-01,10:17 下午  [...] 不用任何插件实现 WordPress 彩色标签云 &#8211; 建站实验室_阿七实验室. [...]访客留言 [...]</p> ]]></content:encoded> </item> <item><title>By: 不用任何插件实现 WordPress 彩色标签云 &#8211; 建站实验室_阿七实验室 &#187; 赵实丰的文摘</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15607</link> <dc:creator>不用任何插件实现 WordPress 彩色标签云 &#8211; 建站实验室_阿七实验室 &#187; 赵实丰的文摘</dc:creator> <pubDate>Thu, 01 Jul 2010 14:18:11 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15607</guid> <description>[...] 方法是 Alex 的英文站那里看来的，直接拿来主义和大家分享之。【此为本文作者原话，我是从showfom的博客里看到的】 [...]</description> <content:encoded><![CDATA[<p>[...] 方法是 Alex 的英文站那里看来的，直接拿来主义和大家分享之。【此为本文作者原话，我是从showfom的博客里看到的】 [...]</p> ]]></content:encoded> </item> <item><title>By: Showfom</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15526</link> <dc:creator>Showfom</dc:creator> <pubDate>Tue, 22 Jun 2010 20:39:02 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15526</guid> <description>&lt;a href=&quot;#comment-15524&quot; rel=&quot;nofollow&quot;&gt;@max&lt;/a&gt;, 注意标点符号，要英文半角</description> <content:encoded><![CDATA[<p><a href="#comment-15524" rel="nofollow">@max</a>, 注意标点符号，要英文半角</p> ]]></content:encoded> </item> <item><title>By: max</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15524</link> <dc:creator>max</dc:creator> <pubDate>Tue, 22 Jun 2010 02:25:04 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15524</guid> <description>我按文章的内容尝试过但是么有成功，不知道问题出在什么地方。如果方便的话联系我下~帮忙解决下，感谢</description> <content:encoded><![CDATA[<p>我按文章的内容尝试过但是么有成功，不知道问题出在什么地方。如果方便的话联系我下~帮忙解决下，感谢</p> ]]></content:encoded> </item> <item><title>By: 乱炖</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15354</link> <dc:creator>乱炖</dc:creator> <pubDate>Sat, 12 Jun 2010 22:50:14 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15354</guid> <description>呵呵，正好用上这个彩色标签云，谢谢~ :mrgreen:</description> <content:encoded><![CDATA[<p>呵呵，正好用上这个彩色标签云，谢谢~ <img src='//showfom.imgbed.com/style/img/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: 不用任何插件实现 WordPress 的彩色标签云 &#171; Zeno&#39;s Blog</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15326</link> <dc:creator>不用任何插件实现 WordPress 的彩色标签云 &#171; Zeno&#39;s Blog</dc:creator> <pubDate>Wed, 09 Jun 2010 16:37:39 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15326</guid> <description>[...] 转自http://zou.lu/,另参考:冰古,Alex [...]</description> <content:encoded><![CDATA[<p>[...] 转自http://zou.lu/,另参考:冰古,Alex [...]</p> ]]></content:encoded> </item> <item><title>By: 鱼小北</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15259</link> <dc:creator>鱼小北</dc:creator> <pubDate>Thu, 03 Jun 2010 14:02:38 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-15259</guid> <description>兽兽这里好东西多啊~呵呵</description> <content:encoded><![CDATA[<p>兽兽小帅锅这里好东西多啊~呵呵</p> ]]></content:encoded> </item> <item><title>By: 柳亚的博客：储籽宫 www.liuya.org &#187; 简单代码实现WordPress 的彩色标签云</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-14791</link> <dc:creator>柳亚的博客：储籽宫 www.liuya.org &#187; 简单代码实现WordPress 的彩色标签云</dc:creator> <pubDate>Mon, 17 May 2010 00:57:28 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-14791</guid> <description>[...] 代码如下：  function colorCloud($text) { $text = preg_replace_callback(&#8216;&#124;&lt;a (.+?)&gt;&#124;i&#8217;, &#8216;colorCloudCallback&#8217;, $text); return $text; } function colorCloudCallback($matches) { $text = $matches[1]; $color = dechex(rand(0,16777215)); $pattern = &#8216;/style=(&#8217;&#124;&#8221;)(.*)(&#8217;&#124;&#8221;)/i&#8217;; $text = preg_replace($pattern, &#8220;style=&#8221;color:#{$color};$2;&#8221;&quot;, $text); return &#8220;&lt;a $text&gt;&#8221;; } add_filter(&#8216;wp_tag_cloud&#8217;, &#8216;colorCloud&#8217;, 1); 说明：8 是最小的 tag 的字体大小（用的最少的 tag），24 是最大的（用的最多的 tag），50 是 tag 的数目，可以自行修改。颜色是随机的，可以修改 $color = dechex(rand(0,16777215));  这行来修改范围。 参考：http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/ [...]</description> <content:encoded><![CDATA[<p>[...] 代码如下：  function colorCloud($text) { $text = preg_replace_callback(&#8216;|&lt;a (.+?)&gt;|i&#8217;, &#8216;colorCloudCallback&#8217;, $text); return $text; } function colorCloudCallback($matches) { $text = $matches[1]; $color = dechex(rand(0,16777215)); $pattern = &#8216;/style=(&#8217;|&#8221;)(.*)(&#8217;|&#8221;)/i&#8217;; $text = preg_replace($pattern, &#8220;style=&#8221;color:#{$color};$2;&#8221;&quot;, $text); return &#8220;&lt;a $text&gt;&#8221;; } add_filter(&#8216;wp_tag_cloud&#8217;, &#8216;colorCloud&#8217;, 1); 说明：8 是最小的 tag 的字体大小（用的最少的 tag），24 是最大的（用的最多的 tag），50 是 tag 的数目，可以自行修改。颜色是随机的，可以修改 $color = dechex(rand(0,16777215));  这行来修改范围。 参考：http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/ [...]</p> ]]></content:encoded> </item> <item><title>By: Wordpress 彩色标签云 &#124; What You See!</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-14336</link> <dc:creator>Wordpress 彩色标签云 &#124; What You See!</dc:creator> <pubDate>Fri, 07 May 2010 15:55:54 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-14336</guid> <description>[...] 本文部分内容来源于：http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/ [...]</description> <content:encoded><![CDATA[<p>[...] 本文部分内容来源于：http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/ [...]</p> ]]></content:encoded> </item> <item><title>By: 卜卜口の</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-11903</link> <dc:creator>卜卜口の</dc:creator> <pubDate>Sat, 23 Jan 2010 06:06:23 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-11903</guid> <description>进来之前买以为是通过javascript识别font-size: 的大小然后给它添加color...</description> <content:encoded><![CDATA[<p>进来之前买以为是通过javascript识别font-size: 的大小然后给它添加color...</p> ]]></content:encoded> </item> <item><title>By: truant</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-11807</link> <dc:creator>truant</dc:creator> <pubDate>Thu, 21 Jan 2010 07:29:35 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-11807</guid> <description>每次在function.php里改东西总会报错,好在最后能够错误的成功.侧栏的代码没改,自动就变成彩色的了,不知道什么.</description> <content:encoded><![CDATA[<p>每次在function.php里改东西总会报错,好在最后能够错误的成功.侧栏的代码没改,自动就变成彩色的了,不知道什么.</p> ]]></content:encoded> </item> <item><title>By: July&#39;s Blog &#187; 不用任何插件实现 WordPress 的彩色标签云 - 因为困难，所以坚持</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-11442</link> <dc:creator>July&#39;s Blog &#187; 不用任何插件实现 WordPress 的彩色标签云 - 因为困难，所以坚持</dc:creator> <pubDate>Wed, 06 Jan 2010 13:41:29 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-11442</guid> <description>[...] 转自：走点路 侧边栏的标签云（Tag Cloud）一直是 WordPress 2.3+ 以后的内置功能，一般直接调用函数 wp_tag_cloud 或者在 Widgets 里开启即可，但是默认的全部是一个颜色，只是大小不一样，很是不顺眼，虽然可以用 Simple Tags 之类的插件，但是总感觉不爽，所以我介绍一个不用任何插件就能显示彩色标签云的方法。 后台编辑 主题 的 functions.php , 输入以下代码 [...]</description> <content:encoded><![CDATA[<p>[...] 转自：走点路 侧边栏的标签云（Tag Cloud）一直是 WordPress 2.3+ 以后的内置功能，一般直接调用函数 wp_tag_cloud 或者在 Widgets 里开启即可，但是默认的全部是一个颜色，只是大小不一样，很是不顺眼，虽然可以用 Simple Tags 之类的插件，但是总感觉不爽，所以我介绍一个不用任何插件就能显示彩色标签云的方法。 后台编辑 主题 的 functions.php , 输入以下代码 [...]</p> ]]></content:encoded> </item> <item><title>By: JuJue</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-10098</link> <dc:creator>JuJue</dc:creator> <pubDate>Mon, 07 Dec 2009 21:05:25 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-10098</guid> <description>functions.php的某行报错, 明儿再试.
兽兽真能干 ^^</description> <content:encoded><![CDATA[<p>functions.php的某行报错, 明儿再试.<br /> 兽兽小帅锅真能干 ^^</p> ]]></content:encoded> </item> <item><title>By: 给博客建立一个标签聚合页面 &#124; 六维博客</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-7709</link> <dc:creator>给博客建立一个标签聚合页面 &#124; 六维博客</dc:creator> <pubDate>Wed, 21 Oct 2009 08:57:59 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-7709</guid> <description>[...] .editComment, .editableComment, .textComment{ display: inline; } .comment-childs{ border: 1px solid #999; margin: 5px 2px 2px 4px; padding: 4px 2px 2px 4px; background-color: white; } .chalt{ background-color: #E2E2E2; } #newcomment{ border:1px dashed #777;width:90%; } #newcommentsubmit{ color:red; } .adminreplycomment{ border:1px dashed #777; width:99%; margin:4px; padding:4px; } .mvccls{ color: #999; }  首页WP团队标签聚合援助计划博客时间蓝冰其人左邻右舍雁过留声 GAE相关WP相关胡思乱想蓝冰生活蓝冰笔记转网偶得随便写写2009-10-21给博客建立一个标签聚合页面  栏目：WP相关 &#160;&#160;&#160;&#160;  28 点击 &#160;&#160;&#160;&#160;  20 枚回复&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 今天在WPG看到关于标签问题的探讨，在讨论中准备使用新页面建立一个标签的聚合页面，其实这个增加一个新的页面模板就可以了，在侧边的标签云只能显示45个最常用的标签，如果更多的话会很乱，但是新的页面要显示所有的标签。&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 下面我们就通过新建页面来实现标签云页面，其实标签页我最早是在zblog上见到的，zblog自带一个标签页，可以显示所有的标签。但是WP并没有自带这个功能，不过已经预留了函数可以方便的调用所有的标签。&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 首先找到模板中的page.php页面，然后在其顶部加入以下代码：&lt;?php /* Template Name: Tags */ ?&gt;然后在适当的位置加入以下代码&lt;?php wp_tag_cloud(&#8217;unit=px&amp;smallest=12&amp;largest=24&amp;number=0&#8242;); ?&gt;一般情况下可以加到&lt;div class=&quot;entry&quot;&gt;后边。或者加一个&lt;div&gt;，如下&lt;div id=&quot;tags&quot;&gt;&lt;?php wp_tag_cloud(&#8217;unit=px&amp;smallest=12&amp;largest=24&amp;number=0&#8242;); ?&gt;&lt;/div&gt;然后将该文件另存为tag.php然后到WP后台新建页面，选择模板为 tags 即可。预览 http://vvvvvv.us/tags&#160;PS:刚才老杨留言说做成彩色的比较好，于是有了以下内容。偶然间想起了兽兽那篇不用插件实现彩色标签的文章，于是拿来看看，顺利完成彩色标签页。不过很多半角的字符都被改成了全角的，这也是不使用代码高亮插件的坏处。将以下代码加入functions.php即可。&lt;?php function colorCloud($text) { $text = preg_replace_callback(&#8217;&#124;&lt;a (.+?)&gt;&#124;i&#8217;, &#8216;colorCloudCallback&#8217;, $text); return $text; } function colorCloudCallback($matches) { $text = $matches[1]; $color = dechex(rand(0,16777215)); $pattern = &#8216;/style=(&#8217;&#124;&quot;)(.*)(&#8217;&#124;&quot;)/i&#8217;; $text = preg_replace($pattern, &quot;style=&quot;color:#{$color};$2;&quot;&quot;, $text); return &quot;&lt;a $text&gt;&quot;; } add_filter(&#8217;wp_tag_cloud&#8217;, &#8216;colorCloud&#8217;, 1); ?&gt;现在我的标签页面显示的是彩色的了，颜色是随机的。如果上面的代码加入后不能使用，可能在发布中被转换成全角，请手工更改，或者点此下载该段代码。  标签： TAGS页面 转载注明：转自六维博客  本站遵循：署名-非商业性使用-禁止演绎 3.0 共享协议  收藏分享： QQ书签 / 百度收藏 / Google书签 / 收藏到鲜果 / Digg / Del.icio.us   &#160;&#160;喜欢 六维博客 的文章，就赶紧订阅吧！   */                        more&#160;&#187;点击取消回复有人回复时邮件通知我/* */ var commentformid = &quot;commentform&quot;; var USERINFO = false; var atreply = &quot;author&quot;; /* */  /* */ var lstcommentid=3902; var needauthoremail=true; var sortflag=&quot;ASC&quot;; /* */  /**/  ﻿ [...]</description> <content:encoded><![CDATA[<p>[...] .editComment, .editableComment, .textComment{ display: inline; } .comment-childs{ border: 1px solid #999; margin: 5px 2px 2px 4px; padding: 4px 2px 2px 4px; background-color: white; } .chalt{ background-color: #E2E2E2; } #newcomment{ border:1px dashed #777;width:90%; } #newcommentsubmit{ color:red; } .adminreplycomment{ border:1px dashed #777; width:99%; margin:4px; padding:4px; } .mvccls{ color: #999; }  首页WP团队标签聚合援助计划博客时间蓝冰其人左邻右舍雁过留声 GAE相关WP相关胡思乱想蓝冰生活蓝冰笔记转网偶得随便写写2009-10-21给博客建立一个标签聚合页面  栏目：WP相关 &nbsp;&nbsp;&nbsp;&nbsp;  28 点击 &nbsp;&nbsp;&nbsp;&nbsp;  20 枚回复&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 今天在WPG看到关于标签问题的探讨，在讨论中准备使用新页面建立一个标签的聚合页面，其实这个增加一个新的页面模板就可以了，在侧边的标签云只能显示45个最常用的标签，如果更多的话会很乱，但是新的页面要显示所有的标签。&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 下面我们就通过新建页面来实现标签云页面，其实标签页我最早是在zblog上见到的，zblog自带一个标签页，可以显示所有的标签。但是WP并没有自带这个功能，不过已经预留了函数可以方便的调用所有的标签。&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 首先找到模板中的page.php页面，然后在其顶部加入以下代码：&lt;?php /* Template Name: Tags */ ?&gt;然后在适当的位置加入以下代码&lt;?php wp_tag_cloud(&#8217;unit=px&amp;smallest=12&amp;largest=24&amp;number=0&#8242;); ?&gt;一般情况下可以加到&lt;div class=&quot;entry&quot;&gt;后边。或者加一个&lt;div&gt;，如下&lt;div id=&quot;tags&quot;&gt;&lt;?php wp_tag_cloud(&#8217;unit=px&amp;smallest=12&amp;largest=24&amp;number=0&#8242;); ?&gt;&lt;/div&gt;然后将该文件另存为tag.php然后到WP后台新建页面，选择模板为 tags 即可。预览 <a href="http://zi.mu/tools/coop/zou.lu/redirect/?http://vvvvvv.us/tags&#160;PS:刚才老杨留言说做成彩色的比较好，于是有了以下内容。偶然间想起了兽兽小帅锅那篇不用插件实现彩色标签的文章，于是拿来看看，顺利完成彩色标签页。不过很多半角的字符都被改成了全角的，这也是不使用代码高亮插件的坏处。将以下代码加入functions.php即可。&#038;lt;?php" rel="nofollow">http://vvvvvv.us/tags&#160;PS:刚才老杨留言说做成彩色的比较好，于是有了以下内容。偶然间想起了兽兽小帅锅那篇不用插件实现彩色标签的文章，于是拿来看看，顺利完成彩色标签页。不过很多半角的字符都被改成了全角的，这也是不使用代码高亮插件的坏处。将以下代码加入functions.php即可。&#038;lt;?php</a> function colorCloud($text) { $text = preg_replace_callback(&#8217;|&lt;a (.+?)&gt;|i&#8217;, &#8216;colorCloudCallback&#8217;, $text); return $text; } function colorCloudCallback($matches) { $text = $matches[1]; $color = dechex(rand(0,16777215)); $pattern = &#8216;/style=(&#8217;|&quot;)(.*)(&#8217;|&quot;)/i&#8217;; $text = preg_replace($pattern, &quot;style=&quot;color:#{$color};$2;&quot;&quot;, $text); return &quot;&lt;a $text&gt;&quot;; } add_filter(&#8217;wp_tag_cloud&#8217;, &#8216;colorCloud&#8217;, 1); ?&gt;现在我的标签页面显示的是彩色的了，颜色是随机的。如果上面的代码加入后不能使用，可能在发布中被转换成全角，请手工更改，或者点此下载该段代码。  标签： TAGS页面 转载注明：转自六维博客  本站遵循：署名-非商业性使用-禁止演绎 3.0 共享协议  收藏分享： QQ书签 / 百度收藏 / Google书签 / 收藏到鲜果 / Digg / Del.icio.us   &nbsp;&nbsp;喜欢 六维博客 的文章，就赶紧订阅吧！   */                        more&nbsp;&raquo;点击取消回复有人回复时邮件通知我/* */ var commentformid = &quot;commentform&quot;; var USERINFO = false; var atreply = &quot;author&quot;; /* */  /* */ var lstcommentid=3902; var needauthoremail=true; var sortflag=&quot;ASC&quot;; /* */  /**/  ﻿ [...]</p> ]]></content:encoded> </item> <item><title>By: RSSA频道 &#187; Blog Archive &#187; 起来，不愿寂寞的博主们！ – WPG 硬文</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-7377</link> <dc:creator>RSSA频道 &#187; Blog Archive &#187; 起来，不愿寂寞的博主们！ – WPG 硬文</dc:creator> <pubDate>Thu, 15 Oct 2009 15:49:44 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-7377</guid> <description>[...] 不用任何插件实现 WordPress 的彩色标签云 (93) [...]</description> <content:encoded><![CDATA[<p>[...] 不用任何插件实现 WordPress 的彩色标签云 (93) [...]</p> ]]></content:encoded> </item> <item><title>By: vaeye</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-6332</link> <dc:creator>vaeye</dc:creator> <pubDate>Tue, 22 Sep 2009 04:56:22 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-6332</guid> <description>收藏，致谢~~ :smile:</description> <content:encoded><![CDATA[<p>收藏，致谢~~ <img src='//showfom.imgbed.com/style/img/smilies/icon_smile.gif' alt=':smile:' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: 胡一刀</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-6122</link> <dc:creator>胡一刀</dc:creator> <pubDate>Sat, 19 Sep 2009 04:30:20 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-6122</guid> <description>oye ，设置成功，谢啦!!☆⌒(*＾-゜)v</description> <content:encoded><![CDATA[<p>oye ，设置成功，谢啦!!☆⌒(*＾-゜)v</p> ]]></content:encoded> </item> <item><title>By: keke</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5959</link> <dc:creator>keke</dc:creator> <pubDate>Tue, 15 Sep 2009 13:20:33 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5959</guid> <description>正是我要找的内容，谢谢。</description> <content:encoded><![CDATA[<p>正是我要找的内容，谢谢。</p> ]]></content:encoded> </item> <item><title>By: 365hope</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5747</link> <dc:creator>365hope</dc:creator> <pubDate>Mon, 14 Sep 2009 04:19:23 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5747</guid> <description>非常好哇，看来这个招数比起使用什么插件要好多啦！ :razz:</description> <content:encoded><![CDATA[<p>非常好哇，看来这个招数比起使用什么插件要好多啦！ <img src='//showfom.imgbed.com/style/img/smilies/icon_razz.gif' alt=':razz:' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Maxsailor</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5642</link> <dc:creator>Maxsailor</dc:creator> <pubDate>Fri, 11 Sep 2009 16:02:50 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5642</guid> <description>嗯！刚好需要，就用上了，挺不错的。 :smile:</description> <content:encoded><![CDATA[<p>嗯！刚好需要，就用上了，挺不错的。 <img src='//showfom.imgbed.com/style/img/smilies/icon_smile.gif' alt=':smile:' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Wordpress diGu 主题预览 - 寂寞部屋</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5515</link> <dc:creator>Wordpress diGu 主题预览 - 寂寞部屋</dc:creator> <pubDate>Fri, 11 Sep 2009 04:23:03 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5515</guid> <description>[...] 主题在wp2.8下貌似没有什么问题，可以支持嵌套评论，零插件支持，sidebar的标签云用到了showfom童学所介绍的彩色标签云效果。不过主题貌似在IE6下有点问题，这里还望各位高手赐教。 [...]</description> <content:encoded><![CDATA[<p>[...] 主题在wp2.8下貌似没有什么问题，可以支持嵌套评论，零插件支持，sidebar的标签云用到了showfom童学所介绍的彩色标签云效果。不过主题貌似在IE6下有点问题，这里还望各位高手赐教。 [...]</p> ]]></content:encoded> </item> <item><title>By: 冰古</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5376</link> <dc:creator>冰古</dc:creator> <pubDate>Thu, 10 Sep 2009 04:46:06 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5376</guid> <description>&lt;a href=&quot;#comment-5332&quot; rel=&quot;nofollow&quot;&gt;@Showfom&lt;/a&gt;, 我说嘛，昨天都好像没这么帅 :grin:</description> <content:encoded><![CDATA[<p><a href="#comment-5332" rel="nofollow">@Showfom</a>, 我说嘛，昨天都好像没这么帅 <img src='//showfom.imgbed.com/style/img/smilies/icon_biggrin.gif' alt=':grin:' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Showfom</title><link>http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5332</link> <dc:creator>Showfom</dc:creator> <pubDate>Thu, 10 Sep 2009 03:45:03 +0000</pubDate> <guid isPermaLink="false">http://zou.lu/colorful-tag-cloud-without-any-plugin-in-wordpress/#comment-5332</guid> <description>&lt;a href=&quot;#comment-5328&quot; rel=&quot;nofollow&quot;&gt;@冰古&lt;/a&gt;,  :idea: 刚换的 被你发现了 哈哈</description> <content:encoded><![CDATA[<p><a href="#comment-5328" rel="nofollow">@冰古</a>, <img src='//showfom.imgbed.com/style/img/smilies/icon_idea.gif' alt=':idea:' class='wp-smiley' /> 刚换的 被你发现了 哈哈</p> ]]></content:encoded> </item> </channel> </rss>