让emlog不显示某个分类的方法
一、首页不显示某个分类的文章
修改emlog根目录include/controller/log_controller.php下
找到$sqlSegment ='ORDER BY top DESC ,date DESC';(我用的emlog5.3.1是第19行)
将这行修改为$sqlSegment ='and sortid not in (9999) ORDER BY top DESC ,date DESC';
这里是在单引号后添加了一句and sortid not in (9999) ,9999是你要屏蔽的分类的分类id
括号里面可以添加多个分类,用英文逗号隔开,如:not in (6666,8888,9999)
二、侧边栏不显示某个分类
修改emlog根目录include/lib/cache.php下
找到function mc_sort()下面第二行
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "sort ORDER BY pid ASC,taxis ASC");
将这行修改为$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "sort where sid not in (9999) ORDER BY pid ASC,taxis ASC");
这里是在ORDER BY前添加了一句where sid not in (9999),9999是你要屏蔽的分类的分类id
括号里面可以添加多个分类,用英文逗号隔开,如:not in (6666,8888,9999)
已有1条评论