Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望给分类列表加个插件接口,可以过滤指定分类 #1731

Open
jrotty opened this issue Feb 10, 2024 · 0 comments
Open

希望给分类列表加个插件接口,可以过滤指定分类 #1731

jrotty opened this issue Feb 10, 2024 · 0 comments
Labels
enhancement Enhancement request

Comments

@jrotty
Copy link
Contributor

jrotty commented Feb 10, 2024

希望给分类列表加个插件接口,通过接口可以过滤指定分类,使其前台分类列表不显示某些分类!

我是做了个主题展示插件,建立了多个分类,分类下放置了一些不同类型的文章,比如全是图片的文章,然后主题有相册文章模板的就会有相册效果,但有些主题没有相册模板,所以我利用插件接口针对性隐藏部分分类下的文章不在首页和搜索页面展示,但现在问题是分类列表还是全部输出的状态,没有办法针对性隐藏部分分类

就是想用插件接口,针对下面代码输出的分类列表,隐藏部分分类

<?php \Widget\Metas\Category\Rows::alloc()->to($cates); ?>
<?php while ($cates->next()): ?>
   <a href="<?php $cates->permalink(); ?>" <?php if($this->is('category', $cates->slug)): ?>class="text-blue"<?php endif; ?>><?php $cates->name(); ?>(<?php $cates->count(); ?>)</a>
<?php endwhile; ?>
@jrotty jrotty added the enhancement Enhancement request label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement request
Projects
None yet
Development

No branches or pull requests

1 participant