dedecms教程:显示tag标签关联的文章数量
2017-04-13 14:26:47
dedecms
1、打开
include/taglib/tag.lib.php
文件 找到 $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)'];
2、修改好后通过[field:count/]
来调用tag标签关联的文章数量 示例: {dede:tag row='10' sort='new' getall='1'} <li><a href="[field:link/]">[field:tag /]([field:count/]篇文章)</a></li> {/dede:tag}