从wordpress woocommerce商店页面上的类别列表中删除子类别

从wordpress woocommerce商店页面上的类别列表中删除子类别

问题描述:

I'd like to remove subcategories ("CHOCOLATE", "CRACKERS", "FRUIT PASTES" "PICKLES, RELISHES AND HONEYS") from the list of categories at the top of my woocommerce shop product pages above my products, please see example:

http://www.partisan-deli.co.uk/index.php/product-category/beautiful-blues/

I have tried various php solutions listed on this website however none of them have seemed to have worked. If I inspect one of the subcategories on the list in chrome them I can hide it by styling the element with display: none; however all the categories in the list simply come up as a.inactive when I inspect them so I am not sure how to target specific examples.

Does anyone have a solution?

Cheers,

M.

我想删除子类别(“CHOCOLATE”,“CRACKERS”,“FRUIT PASTES”“PICKLES,RELISHES AND HONEYS“)从我产品上方的woocommerce商店产品页面顶部的类别列表中,请参阅示例: p>

http://www.partisan-deli.co.uk/index.php/product-category/beautiful- 布鲁斯/ p>

我已尝试过本网站上列出的各种php解决方案,但它们似乎都没有。 如果我在chrome中检查列表中的一个子类别,我可以通过使用display:none;设置元素样式来隐藏它。 但是,当我检查它们时,列表中的所有类别都会显示为a.inactive,因此我不确定如何定位具体示例。 p>

有没有人有解决方案? p>

干杯, p>

M。 p> div>

What do you think of this?

.shop-categories > li:nth-child(2),
.shop-categories > li:nth-child(3),
.shop-categories > li:nth-child(4),
.shop-categories > li:nth-child(5) {
  display: none;
}

screenshot