WordPress结合Elementor去除Read More标签

用Elementor去除Read More标签(推荐使用)

在Elementor编辑器中,选择 “Site Settings” > “Custom CSS”。添加以下CSS代码:

.elementor-button.product_type_simple,
.products .product .button {
    display: none !important;
}

使用CSS

在你的主题的style.css文件或自定义CSS区域添加以下代码:

.products .product .button {
    display: none;
}

使用PHP

在你的主题的functions.php文件中添加以下代码:

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );

使用WooCommerce钩子

同样在functions.php文件中,你可以使用以下代码:

add_action( 'init', 'remove_read_more_button' );
function remove_read_more_button() {
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
}

Share

You may also like...

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注