久久亚洲五月天,一区二区三区黄色录像,操老太婆骚逼xxxxx,色婷婷综合久久中文字幕雪峰

歡迎來到合肥浪訊網(wǎng)絡(luò)科技有限公司官網(wǎng)
  咨詢服務(wù)熱線:400-099-8848

知識(shí)付費(fèi)和直播可能就是泡沫

發(fā)布時(shí)間:2015-04-04 文章來源:  瀏覽次數(shù):3809
看到良多博客都有標(biāo)簽聚合的功能,于是花了點(diǎn)兒時(shí)間找了找,找到了這個(gè)方法。

下面和大家共享下:


首先復(fù)制一份你博客主題的page.php模板


然后在其頂部加入


<?php
/*
Template Name: Tags
*/
?>


然后將這種顯示正文內(nèi)容的代碼換成調(diào)用tags的代碼


<?php the_content(); ?>


換成


<?php wp_tag_cloud(‘smallest=12&largest=18&unit=px&number=0&orderby=count&order=DESC’);?>


在style.css里面增加如下代碼可以使得間距更好看:


#page-cnt.tags,
#page-cnt.friends { height: 576px; padding: 6px 0 0; overflow: hidden; line-height: 30px; }
#page-cnt.tags,
#page-cnt.friends { height: auto; padding-top: 5px; overflow: visible; }
.tags a { display: inline-block; margin: 0 4px; white-space: nowrap; }


打開主題中的functions.php文件,在最末真?zhèn) ?>前面添加下面的代碼,就可以實(shí)現(xiàn)彩色標(biāo)簽云了:


;
function colorCloud($text) {
$text = preg_replace_callback(‘|<a (.+?)>|i’,'colorCloudCallback’, $text);
return $text;
}
function colorCloudCallback($matches) {
$text = $matches[1];
$color = dechex(rand(0,16777215));
$pattern = ‘/style=(\’|\”)(.*)(\’|\”)/i’;
$text = preg_replace($pattern, “style=\”color:#{$color};$2;\”", $text);
return “<a $text>”;
}
add_filter(‘wp_tag_cloud’, ‘colorCloud’, 1);


大功告成,在后臺(tái)新建一個(gè)tags頁面就可以了。

上一條:80后為互聯(lián)網(wǎng)人群借款主...

下一條:必要商城,你這黑公關(guān)做的...

拜城县| 蓝田县| 松江区| 辽阳市| 自治县| 鞍山市| 徐汇区| 防城港市| 洞头县| 西峡县| 故城县| 乌拉特后旗| 兴安县| 深水埗区| 龙州县| 铅山县| 淮安市| 吴桥县| 乌苏市| 嫩江县| 中西区| 荣昌县| 临沭县| 万荣县| 镇雄县| 锦屏县| 璧山县| 博湖县| 衡山县| 太仓市| 城口县| 航空| 东源县| 五常市| 揭西县| 平利县| 白山市| 辽阳市| 余干县| 封丘县| 彝良县|