Typecho菜单导航隐藏(不显示)某个分类

  • A+
所属分类:Typecho

隐藏页面

后台导航菜单管理 - 独立页面选择要隐藏的页面,高级选项 - 公开度 - 隐藏

隐藏分类

一般在模板的header.php文件,找Typecho输出分类的主要函数

$this->widget('Widget_Metas_Category_List')

给这个函数添加具体参数ignore。

系统文件/var/Widget/Metas/Category/Edit.php对应代码为

/** 父级分类 */
$options = array(0 => _t('不选择'));
$parents = $this->widget('Widget_Metas_Category_List@options', 
    (isset($this->request->mid) ? 'ignore=' . $this->request->mid : ''));
 
while ($parents->next()) {
    $options[$parents->mid] = str_repeat('    ', $parents->levels) . $parents->name;
}

改为

$this->widget('Widget_Metas_Category_List@options','ignore=3')
weinxin
独角兽驿站
公众号

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: