Typecho随机彩色标签的实现方法

No Reply , Posted in 代码 on April 27, 2014

<?php $this-&gt;widget('Widget_Metas_Tag_Cloud', 'ignoreZeroCount=1&limit=30')-&gt;to($tags); ?>
<?php while($tags->next()): ?>
<span><a style="color:rgb(<?php echo(rand(0,255)); ?>,<?php echo(rand(0,255)); ?>,<?php echo(rand(0,255)); ?>)" href="<?php $tags-&gt;permalink(); ?&gt;" title='&lt;?php $tags->name(); ?>'><?php $tags->name(); ?></a></span>

效果:
请输入图片描述

标签: 标签