I have a product category called Cable, and I want to grab all posts assigned to this category and output the title of said posts. This category is from the custom taxonomy ‘Category’ that woo-commerce adds, I’m not sure if that makes things harder? but I haven’t found a solution yet.
Could anyone assist with this?
4
Answers
You can use
WP_Query()
with tax_query().EDIT:
Try out this code to get products on category page.
Try this code:
And modify as per your requirements:
Use this code to show all posts assigned to the category cable
I have created with list