Product category page is not a main query
-
Hello,
First of all, thanks for your awesome plugin !
I’ve noticed that it doesn’t work on category pages on my freshly installed Woocommerce. After digging a little, I found out that the category loop is not the “mainquery”, that’s why the sorting didn’t work. I don’t know why is that, but $query->is_main_query() is returning false.
I change the condition on the rearrange-woocommmerce-product.php file line 249
“if ( $query->is_main_query() && is_woocommerce() && is_product_category() ) {”
by
“if (!is_admin() && is_woocommerce() && is_product_category() && $query->get( ‘post_type’ ) == “product”) {”and it worked.
Hope it helps
- The topic ‘Product category page is not a main query’ is closed to new replies.