【问题标题】:Remove subcategories from list of categories on wordpress woocommerce shop page从 wordpress woocommerce 商店页面上的类别列表中删除子类别
【发布时间】:2017-12-15 18:20:07
【问题描述】:

我想从我的产品上方的 woocommerce 商店产品页面顶部的类别列表中删除子类别(“巧克力”、“饼干”、“水果酱”、“泡菜、调味品和蜂蜜”),请见例子:

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

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

有人有解决办法吗?

干杯,

M.

【问题讨论】:

标签: php html css wordpress woocommerce


【解决方案1】:

你怎么看?

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

【讨论】:

  • 我认为您,先生,是个英雄。谢谢,效果很好。
  • 我从这个网站学到了很多东西,我很少提出问题并且没有得到快速的答案:)
  • @user8236504,不客气!不要犹豫,向 StackOverflow 社区提出更多问题,我们都很友好! :) 继续编码!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-03-05
  • 1970-01-01
  • 2019-12-14
  • 1970-01-01
  • 2015-12-19
  • 1970-01-01
  • 2021-11-14
相关资源
最近更新 更多