简体   繁体   English

如果类别中没有产品,如何从类别下拉列表中删除类别

[英]How to remove categories from category dropdown if no products within the category

I want to be able to hide categories in a categories drop down menu (wordpress + woocommerce) if the number of products within the category is 0. Does somebody know how to do this?如果类别中的产品数量为 0,我希望能够在类别下拉菜单(wordpress + woocommerce)中隐藏类别。有人知道该怎么做吗? I tried this below:我在下面试过这个:

wp_dropdown_categories('hide_empty=0');

and

wp_dropdown_categories('excludes=0');

wp_dropdown_categories( array|string $args = '' )

在此处输入图像描述

wp_dropdown_categories('hide_if_empty=true');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM