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

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

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

發(fā)布時(shí)間:2015-04-04 文章來源:  瀏覽次數(shù):3825
看到良多博客都有標(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)做的...

大关县| 临朐县| 双城市| 江津市| 库车县| 鹿泉市| 丰顺县| 平安县| 玛纳斯县| 建瓯市| 丹寨县| 邯郸市| 高邮市| 东安县| 文登市| 怀远县| 维西| 抚宁县| 吴堡县| 莆田市| 玛纳斯县| 留坝县| 遂川县| 新源县| 宜州市| 建昌县| 革吉县| 霍林郭勒市| 赤峰市| 桂东县| 泽普县| 莆田市| 广西| 泗洪县| 洞口县| 怀化市| 海原县| 太保市| 甘肃省| 和政县| 宁南县|