Home >CMS Tutorial >DEDECMS >How does Dreamweaver tag display the number of articles corresponding to each tag?
How to display the number of articles corresponding to each tag in the DreamWeaver tag?
Dreamweaver tag displays the number of articles corresponding to each tag
Recommended learning: Dreamweaver cms
Sometimes we want to achieve something similar For tags like WordPress, while displaying the link and tag name of the tag, it can also display the number of articles associated with each tag. As shown in the figure below:
This requires modifying the file /include/taglib/tag.lib.php and finding "$row['link'] = $cfg_cmsurl."/tags around line 87. php?/".urlencode($row['keyword'])."/";'
Add the following code below this line:
$count = $dsql->GetOne("Select count(tid) From `dede_taglist` where tag = '".$row['tag']."'"); $row['count'] = $count['count(tid)'];
After adding it, you can pass [ field:count/] to get the number of articles associated with the current tag tag, for example:
{dede:tag sort='hot' getall='2'} <li><a title="[field:count/]个话题" href="[field:link/]">[field:tag /]</a></li> {/dede:tag}
The above is the detailed content of How does Dreamweaver tag display the number of articles corresponding to each tag?. For more information, please follow other related articles on the PHP Chinese website!