CSS 添加:

/* related products */
.woocommerce .related ul li.product,
.woocommerce .related ul.products li.product,
.woocommerce-page .related ul li.product,
.woocommerce-page .related ul.products li.product{
display:none;
}

代码 edit snippet :

add_filter(‘gettext’, ‘change_rp_text’, 10, 3);
add_filter(‘ngettext’, ‘change_rp_text’, 10, 3);

function change_rp_text($translated, $text, $domain)
{
if ($text === ‘Related products’ && $domain === ‘woocommerce’) {
$translated = esc_html__(”, $domain);//这里单引号替换的问题,替换为空
}
return $translated;
}

Leave a Reply

Your email address will not be published.