7

Typecho隐藏不显示某一个特定分类教程

 3 years ago
source link: https://www.ioiox.com/archives/54.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

本文将介绍替换一条代码,实现Typecho隐藏不显示特定分类.

本文为 Stille 原创文章.经实践,测试,整理发布.如需转载请联系作者获得授权,并注明转载地址.

找到希望隐藏的分类mid

进入typecho后台
管理-分类
点击你希望隐藏的分类名
此时浏览器上的url链接末尾数字就是你的分类mid

编辑替换代码

找到你typecho主题对应的首页分类所在的php文件,本文以handsome主题为例,其文件为 /usr/themes/handsome/component/aside.php

编辑aside.php
搜索关键词Widget_Metas_Category_List找到以下图中代码

替换代码

$this->widget('Widget_Metas_Category_List@options','ignore=1')

其中ignore=1中的数字为你希望隐藏的分类mid

效果如图,全站页面左侧分类栏里就隐藏掉了该分类.


目前此方法只能隐藏掉一个分类,如有大神知道如何简单的隐藏掉多个分类,或者有此功能的插件,请留言推荐给我和大家,谢谢!


本站提供免费和付费的技术支持.你可以通过留言,邮件,TG群的方式来技术交流和免费咨询.同时也可以付费支持的方式获得相关的技术支持,项目部署配置等服务.具体相关详情请点击查看 技术支持页面

如果喜欢我的文章,觉得对你有帮助,请随意赞赏!

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK