【问题标题】:Can't remove generated product data on single product page无法删除单个产品页面上生成的产品数据
【发布时间】:2019-03-06 01:38:23
【问题描述】:

我试图在单个产品页面上隐藏产品数据,我尝试了许多解决方案,例如使用 'woocommerce_single_product_summary' 的钩子,但没有任何结果

 add_filter( 'woocommerce_structured_data_product', 'structured_data_product_nulled', 10, 2 );

    function structured_data_product_nulled( $markup, $product ){
        $markup = '' ;
        return $markup;
    }

但是我不能删除生成的数据,这是函数

Here are the attributes that i wan't to hide, they're allready in tabs i don't want them to be shown in the description

【问题讨论】:

标签: wordpress woocommerce product


【解决方案1】:

我会隐藏使用 CSS 作为其最快的方式。 只需打开谷歌浏览器右键单击项目并选择检查器。

进入 Inspector 点击右上角的 + 这将为元素创建一个新的 CSS 类。

输入

 display:none

如果元素消失,请将 CSS 复制并粘贴到 wordpress 管理员外观 > 定制器附加 CSS。

这将隐藏这些项目。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-04-03
    • 2019-02-11
    • 1970-01-01
    • 1970-01-01
    • 2018-07-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多