[英]Is there a way to display dinamic widget of categories leaving one of them out in wordpress?
I want to have a widget inside by sidebar that show all the categories ( except one ) of my wordpress site.我想在侧边栏中有一个小部件,显示我的 wordpress 站点的所有类别(除了一个类别)。
Want to made it dinamical so whenever I made a new category, by deafult appear inside my widget.想要让它变得生动,所以每当我创建一个新类别时,默认情况下都会出现在我的小部件中。
I already tried to insert the wordpress' default widget of the categories but doing this it show me all the categories and I don't have any possibilities to hide one as I want.我已经尝试插入 wordpress 的默认类别小部件,但这样做会向我显示所有类别,而且我无法根据需要隐藏任何类别。
There is any fix for this problem?这个问题有什么解决办法吗?
I'm using Basel theme 5.0.0 and version 5.4.2 of wordpress .我正在使用巴塞尔主题 5.0.0和wordpress 5.4.2 版。 Thank you.
谢谢你。
The default widget has some hook :默认小部件有一些钩子:
https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_categories_args https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_categories_args
As the sample do, you can exclude programmatically any categories.正如示例所做的那样,您可以通过编程方式排除任何类别。
https://wordpress.stackexchange.com/questions/192051/hide-specific-categories-from-category-widget https://wordpress.stackexchange.com/questions/192051/hide-specific-categories-from-category-widget
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.