打開/include/common.func.php文件
在最下面加入函數
<span style="font-size:14px;">function GetTotalArca($tid){
global $dsql;
$sql = GetSonIds($tid);
$row = $dsql->GetOne("Select count(id) as dd From dede_archives where typeid2 in({$sql})");
return $row['dd'];
}</span>
然后在自己需要調用副欄目文章數量的地方加上調用標簽:
[field:ID function='GetTotalArca(@me)'/]
//此中調用當副欄目下無文章時顯示“空”
[field:ID runphp='yes'] @me = GetTotalArca(@me);[/field:ID]
//此中調用當副欄目下無文章時顯示“0”