I searched for relevant articles before but it could not be applied.

In Woocommerce, I just want to display products in subcategory, not show products in parent category, how to add code in file function.php, Child theme, don't use Cross sell, up sell is available.

For example, the category tree is: Mobile> Apple> Iphone The product is: Iphone 11 I only want Related products in "Iphone 11" products to show "Iphone" category, not show products in "Apple" and "Mobile" categories.

  • Welcome to WordPress StackExchange, what have you try so far? Maybe you can show us your code and then maybe there is a better chance that you will get an answer. How to ask a question – user141080 May 27 '20 at 19:30

Please visit this URL: https://businessbloomer.com/woocommerce-show-product-subcategories/ maybe it will help you.

  • Hi Yash, thanks for your comment. Unfortunately, the code snippet doesn't work on my website. I use the astra theme and elementor plugin to build the site. – emptyss May 27 '20 at 3:15
  • Could you please provide a page URL where you want to do this? It will help to solve the same. – Yash Tiwari May 27 '20 at 7:40
  • Hi Yash, my website is: psi-vn.com/may-nen-khi-truc-vit-eg37. Thanks for your help – emptyss May 28 '20 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.