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!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.