最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

woocommerce offtopic - selecting categories that have products with tagcategory

programmeradmin1浏览0评论

i have a lot of product categories on the website - 100+ some products are tagged as "is_new" via custom field. When that happens that are also automatically assigned to a product category "New". Meaning each product can be assign to its own category + category "New". When i go to category new in the front end i want users to see all categories that contain "New" products for navigation.

What would be the best way to do that? First select all "new" products and then get a tree from their categories? or is there a better way?

i have a lot of product categories on the website - 100+ some products are tagged as "is_new" via custom field. When that happens that are also automatically assigned to a product category "New". Meaning each product can be assign to its own category + category "New". When i go to category new in the front end i want users to see all categories that contain "New" products for navigation.

What would be the best way to do that? First select all "new" products and then get a tree from their categories? or is there a better way?

Share Improve this question asked May 30, 2019 at 18:48 AndrewAndrew 1
Add a comment  | 

1 Answer 1

Reset to default 0

Hi im not really experienced but I think you could do this with WP_Query. You can do amazing things with it but I dont know how to use it so I cant give example

Edit after the minute I posted this: I think my answer is completely off topic how can I delete it?

发布评论

评论列表(0)

  1. 暂无评论