I saw a lot of questions on stackoverflow about removing this dropdown. I want to ADD IT on my theme and it doesn’t work.
I tried adding this:
add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 );
aaand didn’t work.
What’s the catch? I already have in my archive-product.php this piece of code:
<?php
/**
* woocommerce_before_shop_loop hook
*
* @hooked woocommerce_result_count - 20
* @hooked woocommerce_catalog_ordering - 30
*/
do_action( 'woocommerce_before_shop_loop' );
?>
So the sorting template is included, right? Where am I messing this up?
First add this to your functions.
Then wherever you want to have the sort box just drop it in.
Found the solution thanks to Anand. the .woocommerce-ordering class had a display:none on it.