發(fā)表日期:2017-10 文章編輯:小燈 瀏覽次數(shù):1880
如果想讓織夢的tag標(biāo)簽顯示出每個tag標(biāo)簽所關(guān)聯(lián)的文章數(shù)量,我們需要對織夢的文件進(jìn)行改動,因為織夢默認(rèn)的tag并沒有這個功能。那么來看一下如何修改。
打開“/include/taglib/tag.lib.php”文件,
在里面找到代碼(注意:如果tag標(biāo)簽做了靜態(tài)化,可能會不一樣,這段代碼大概在87行左右):
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/"; |
$count = $dsql->GetOne("Select count(tid) From `dede_taglist` where tag = '".$row['tag']."'");$row['count'] = $count['count(tid)']; |
修改完成以后就可以獲取tag標(biāo)簽關(guān)聯(lián)的文章數(shù)量了,用“[field:count/]”調(diào)用。如下面的代碼:
{dede:tag row='18' sort='month' getall='1'}<a title="[field:count/]個話題" href='[field:link/]'>[field:tag /]([field:count/])</a>{/dede:tag} |
日期:2018-10 瀏覽次數(shù):3752
日期:2018-10 瀏覽次數(shù):3501
日期:2018-08 瀏覽次數(shù):3585
日期:2018-06 瀏覽次數(shù):3336
日期:2018-06 瀏覽次數(shù):3184
日期:2018-06 瀏覽次數(shù):3237
日期:2018-06 瀏覽次數(shù):3498
日期:2018-06 瀏覽次數(shù):3339
日期:2018-06 瀏覽次數(shù):3260
日期:2018-06 瀏覽次數(shù):3435
日期:2018-05 瀏覽次數(shù):3342
日期:2018-05 瀏覽次數(shù):4151
日期:2018-05 瀏覽次數(shù):3255
日期:2018-05 瀏覽次數(shù):3668
日期:2018-04 瀏覽次數(shù):4120
日期:2018-03 瀏覽次數(shù):3260
日期:2018-03 瀏覽次數(shù):3136
日期:2018-03 瀏覽次數(shù):3323
日期:2018-02 瀏覽次數(shù):3318
日期:2018-02 瀏覽次數(shù):3286
日期:2017-12 瀏覽次數(shù):3427
日期:2017-12 瀏覽次數(shù):3661
日期:2017-12 瀏覽次數(shù):3845
日期:2017-12 瀏覽次數(shù):3218
日期:2017-12 瀏覽次數(shù):3204
日期:2017-11 瀏覽次數(shù):3242
日期:2017-11 瀏覽次數(shù):3314
日期:2017-11 瀏覽次數(shù):3213
日期:2017-11 瀏覽次數(shù):3340
日期:2017-11 瀏覽次數(shù):3909
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.