试试
获得指定分类目录id或指定TAG标签id,之后就可以在需要的地方使用如下代码来调用functions文件里的函数就可以实现想要的功能了:
if (is_category())
{
get_most_viewed_category(get_current_category_id());
}
elseif (is_tag())
{
get_most_viewed_tag(get_current_tag_id());
}
else {
get_most_viewed();
}
?>