【发布时间】:2020-12-10 11:34:30
【问题描述】:
我想在 woocommerce 的帐户页面的表格中隐藏一行。此项目在表 class= shop_table subscription_details 中称为“结束”或“结束日期”。
CSS sn-p 怎么办?
【问题讨论】:
-
这个问题需要您提供更多关于输出标记是什么样子的输入。基于此,可以考虑 CSS 规则。
标签: php css wordpress woocommerce
我想在 woocommerce 的帐户页面的表格中隐藏一行。此项目在表 class= shop_table subscription_details 中称为“结束”或“结束日期”。
CSS sn-p 怎么办?
【问题讨论】:
标签: php css wordpress woocommerce
您不应该使用 CSS 来隐藏它,而是在您的子主题中替换模板。 Woocommerce 使用模板系统,允许干净地修改其插件或自身的模板。
在您的子主题中创建文件夹“woocommerce/myaccount”并从插件中复制subscription-details.php。
然后您将拥有以下路径:
/themes/yourtheme/woocommerce/myaccount/subscription-details.php
来源:https://docs.woocommerce.com/document/template-structure/
然后编辑这个文件并删除这一行:
'end' => _x( 'End date', 'customer subscription table header', 'woocommerce-subscriptions' ),
所以你将拥有:
$dates_to_display = apply_filters( 'wcs_subscription_details_table_dates_to_display', array(
'start_date' => _x( 'Start date', 'customer subscription table header', 'woocommerce-subscriptions' ),
'last_order_date_created' => _x( 'Last order date', 'customer subscription table header', 'woocommerce-subscriptions' ),
'next_payment' => _x( 'Next payment date', 'customer subscription table header', 'woocommerce-subscriptions' ),
'trial_end' => _x( 'Trial end date', 'customer subscription table header', 'woocommerce-subscriptions' ),
), $subscription );
它应该可以解决问题
【讨论】: