WordPress如何實(shí)現(xiàn)彩色標(biāo)簽云

WordPress如何實(shí)現(xiàn)彩色標(biāo)簽云

wordpress如何實(shí)現(xiàn)彩色標(biāo)簽云

彩色標(biāo)簽云我們?cè)诤芏嗟木W(wǎng)站都可以看到此類效果,這里就來實(shí)現(xiàn)WordPress增加彩色標(biāo)簽云效果。

這種彩色標(biāo)簽云效果可以通過修改Simple Tags來顯示。

1.在simple-tags.client.php中先找到如下代碼:

function?getColorByScale($scale_color,?$min_color,?$max_color)

2.注釋掉(或者刪除)getColorByScale這個(gè)function中的以下語句:

$scale_color?=?$scale_color?/?100;? $minr?=?hexdec(substr($min_color,?1,?2));? $ming?=?hexdec(substr($min_color,?3,?2));? $minb?=?hexdec(substr($min_color,?5,?2));? $maxr?=?hexdec(substr($max_color,?1,?2));? $maxg?=?hexdec(substr($max_color,?3,?2));? $maxb?=?hexdec(substr($max_color,?5,?2));? $r?=?dechex(intval((($maxr?-?$minr)?*?$scale_color)?+?$minr));? $g?=?dechex(intval((($maxg?-?$ming)?*?$scale_color)?+?$ming));? $b?=?dechex(intval((($maxb?-?$minb)?*?$scale_color)?+?$minb));

3.加上以下代碼:

//Colorful?Tag?Cloud?start? $r?=?dechex(rand(0,255));? $g?=?dechex(rand(0,196));? $b?=?dechex(rand(0,255));

Colorful Tag Cloud end至于要顯示多少個(gè)標(biāo)簽,怎么排列,熱門標(biāo)簽和普通標(biāo)簽分別為多少大小的字體,可以在后臺(tái)的Simple Tags的選項(xiàng)中設(shè)置。

推薦教程:WordPress教程

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊5 分享