changes
This commit is contained in:
@@ -25,6 +25,16 @@ class DontShowProductsOnShopLandingPageAction extends RadAction
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove everything hooked to the product loop
|
||||||
|
remove_all_actions('woocommerce_before_shop_loop');
|
||||||
|
remove_all_actions('woocommerce_shop_loop');
|
||||||
|
remove_all_actions('woocommerce_after_shop_loop');
|
||||||
|
|
||||||
|
// Also prevent product loop rendering itself
|
||||||
|
remove_all_actions('woocommerce_before_main_content');
|
||||||
|
remove_all_actions('woocommerce_after_main_content');
|
||||||
|
remove_all_actions('woocommerce_no_products_found');
|
||||||
|
|
||||||
add_action('pre_get_posts', function ($query) {
|
add_action('pre_get_posts', function ($query) {
|
||||||
if (!is_admin() && $query->is_main_query()) {
|
if (!is_admin() && $query->is_main_query()) {
|
||||||
$query->set('post_type', 'product');
|
$query->set('post_type', 'product');
|
||||||
|
|||||||
Reference in New Issue
Block a user