I'm trying to change the default content on my shop page. My site is using WooCommerce with a child of the Storefront theme.
In my child theme's functions.php I added the following:
function remove_catalog_defaults() {
remove_action( 'homepage', 'storefront_homepage_content', 10 );
remove_action( 'homepage', 'storefront_product_categories', 20 );
remove_action( 'homepage', 'storefront_recent_products', 30 );
remove_action( 'homepage', 'storefront_featured_products', 40 );
remove_action( 'homepage', 'storefront_popular_products', 50 );
remove_action( 'homepage', 'storefront_on_sale_products', 60 );
remove_action( 'homepage', 'storefront_best_selling_products', 70 );
remove_action( 'woocommerce_after_shop_loop', 'storefront_sorting_wrapper', 9 );
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 );
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 30 );
remove_action( 'woocommerce_after_shop_loop', 'storefront_sorting_wrapper_close', 31 );
remove_action( 'woocommerce_before_shop_loop', 'storefront_sorting_wrapper', 9 );
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 );
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_before_shop_loop', 'storefront_woocommerce_pagination', 30 );
remove_action( 'woocommerce_before_shop_loop', 'storefront_sorting_wrapper_close', 31 );
}
add_action( 'storefront_before_content', 'remove_catalog_defaults', 5);
But everything is still loading on the shop page. You can see it here: https://staging.embrace.gallery/all-artwork/
First the content I want loads (4 rows of products), then the default shop page loads underneath it. How do I get rid of all the default content?
EDIT: Some of the remove_action calls seem to be working. The sorting and pagination are gone, only the product grid itself remains.
after_setup_themewithinitorwoocommerce_init. - Vincenzo Di Gaetano