5月17日 11:36
你可以在 functions.php 中加一段代码,使用 is_product() 和产品 ID 或 slug 判断,只对特定产品页面移除页眉和页脚,例如:
add_action( 'template_redirect', function() {
if ( is_product() && is_single(123) ) {
remove_all_actions( 'woodmart_header' );
remove_all_actions( 'woodmart_footer' );
}
});
这样不会影响其他页面,也比全局隐藏更安全有效。





