How can I hide WooCommerce default content from shop page? So far I have been Googleing like crazy but I cant find any solution.
I found this old answer but this code doesn’t do anything
/**
* @snippet Remove Product Loop @ WooCommerce Shop
*/
add_action( 'pre_get_posts', 'njengah_remove_products_from_shop_page' );
function njengah_remove_products_from_shop_page( $q ) {
if ( ! $q->is_main_query() ) return;
if ( ! $q->is_post_type_archive() ) return;
if ( ! is_admin() && is_shop() ) {
$q->set( 'post__in', array(0) );
}
remove_action( 'pre_get_posts', 'njengah_remove_products_from_shop_page' );
}
Has anyone got a solution for this issue?
2
Answers
So I accomplished results I wanted with unsetting all the hooks
Not perfect but It works