0

I have a category id and now I want to get the list of products which have the same category id.

How to do it?

2
0
$args = array(
'post_status' => 'publish',
'tax_query' => array(
     'taxonomy' => 'categories name',
     'field'    => 'id',
     'term'     =>  'category id'
     )
);
$the_query = wp_query($args);
1
  • Please edit your answer, and add an explanation: why could that solve the problem? – fuxia Nov 24 '17 at 13:17

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