简体   繁体   English

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

[英]Remove subcategories from list of categories on wordpress woocommerce shop page

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: 我想从产品上方我的woocommerce商店产品页面顶部的类别列表中删除子类别(“巧克力”,“薄脆饼干”,“水果酱”,“泡菜,甜食和蜂蜜”),请参见示例:

http://www.partisan-deli.co.uk/index.php/product-category/beautiful-blues/ 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. 我已经尝试了本网站上列出的各种php解决方案,但是似乎都没有用。 If I inspect one of the subcategories on the list in chrome them I can hide it by styling the element with display: none; 如果我检查了chrome列表中的子类别之一,则可以通过使用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. 但是,当我检查它们时,列表中的所有类别只是简单地显示为a.inactive,因此我不确定如何针对特定示例。

Does anyone have a solution? 有没有人有办法解决吗?

Cheers, 干杯,

M. M.

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;
}

屏幕截图

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

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