Support

Account

Home Forums General Issues Get product category (Woocommerce) with a taxonomy field to filter the loop Reply To: Get product category (Woocommerce) with a taxonomy field to filter the loop

  • In your first example you are using the category__in argument which can only be used with the category taxonomy.

    In WooCommerce the product category taxonomy is a custom taxonomy. Since it is a custom taxonomy instead of using category__in in your second example you should use a tax_query. Take a look at the tax_query documentation for wp_query, it is pretty intuitive to set up if you are not familiar with it.

    Hope this is helpful!