在首页隐藏zblog指定分类下的文章
找到你要隐藏的分类ID

编辑主题文件夹目录下的include.php文件,在那个目录下,要看你用的哪个主题

找到 function ActivePlugin_主题名
在这个功能下添加下面一行:
plaintext
Add_Filter_Plugin('Filter_Plugin_ViewList_Core','exclude_category');
然后再文件的尾部,?> 上面添加以下内容:
plaintext
function exclude_category(&$type,&$page,&$category,&$author,&$datetime,&$tag,&$w,&$pagebar){
global $zbp;
if($type == 'index'){
$w[]=array('<>','log_CateID',3); //3为你要隐藏的分类ID
//以下是为了重建分页,过滤了分类,数量会发生变化
$pagebar = new Pagebar($zbp->option['ZC_INDEX_REGEX']);
$pagebar->PageCount = $zbp->displaycount;
$pagebar->PageNow = $page;
$pagebar->PageBarCount = $zbp->pagebarcount;
}
}
保存后刷新网页,
此操作会隐藏指定分类的文章,仅不在首页显示,
如搜索页还是可以搜索到隐藏的文章,
如要隐藏搜索页显示,可使用插件【 搜索优化支持分页 】,下载地址:搜索优化支持分页 - Z-Blog 应用中心 (zblogcn.com)

启用后,在插件配置里填上要隐藏的类目ID
