【问题标题】:Target only single product pages with CSS in WooCommerce在 WooCommerce 中仅使用 CSS 定位单个产品页面
【发布时间】:2018-05-25 15:21:51
【问题描述】:

使用 CSS,我基本上是使用 display:none 在 WooCommerce 中隐藏数量字段。但它也会删除购物车和愿望清单页面上的数量字段。

我怎样才能只定位单个产品页面?

我也可以通过页面 ID 做到这一点,但我有 100 种产品,这不是一种实用的方法。

【问题讨论】:

  • 只需在 CSS 中使用 body 类 single-product
  • 感谢@LoicTheAztec 它有效

标签: css wordpress woocommerce product product-quantity


【解决方案1】:

要定位 Woocommerce 单一产品页面,只需使用 <body>single-product

例如隐藏数量字段(仅在单个产品页面上):

.single-product .quantity {
    display:none;
}

【讨论】:

    猜你喜欢
    • 2016-10-02
    • 1970-01-01
    • 2016-10-01
    • 2018-07-07
    • 2016-07-24
    • 2019-03-05
    • 2023-01-22
    • 1970-01-01
    • 2020-07-11
    相关资源
    最近更新 更多