如何在WooCommerce中添加产品分类下拉列表?

时间:2022-10-25 10:15:34

I saw a lot of questions on * 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.

aaand没用。

What's the catch? I already have in my archive-product.php this piece of code:

有什么收获?我已经在我的archive-product.php中输入了这段代码:

<?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?

所以包括排序模板,对吧?我搞砸了哪里?

1 个解决方案

#1


1  

Found the solution thanks to Anand. the .woocommerce-ordering class had a display:none on it.

感谢Anand找到了解决方案。 .woocommerce-ordering类有一个display:none就可以了。

#1


1  

Found the solution thanks to Anand. the .woocommerce-ordering class had a display:none on it.

感谢Anand找到了解决方案。 .woocommerce-ordering类有一个display:none就可以了。