第一、添加include.php文件
在主题的include.php文件最后一行?>之前加上代码。
function exclude_category(&$type,&$page,&$category,&$author,&$datetime,&$tag,&$w,&$pagebar){
global $zbp;
if($type == 'index'){
$w[]=array('<>','log_CateID',1);
//以下是为了重建分页,过滤了分类,数量会发生变化
$pagebar = new Pagebar($zbp->option['ZC_INDEX_REGEX']);
$pagebar->PageCount = $zbp->displaycount;
$pagebar->PageNow = $page;
$pagebar->PageBarCount = $zbp->pagebarcount;
}
}在上面代码中的第四行,看到默认是设置1分类,我们可以设置其他对应分类ID,这样就排除不显示。
第二、激活设置功能
一般是在ActivePlugin_主题ID(){}激活函数中添加以下代码。
Add_Filter_Plugin('Filter_Plugin_ViewList_Core','exclude_category');