0

I want to show all product satisfy 2 conditional are array product id and array categories id . I tried this code but it's not working

$args = array( 
   'post_type' => 'product', 
   'post_status' =>'publish', 
   'post__in' => array(1,2,3) 
   'tax_query' => array( 
      'relation' => 'AND', 
       array( 
          'taxonomy' => 'product_cat', 
          'field' => 'id', 
          'terms' => array( 103, 115, 206 ), 
          'include_children' => false, 
          'operator' => 'IN' 
       ), 
    ) 
$the_query = new WP_Query( $args );

Please give me some ideas ?

5
  • $args = array( 'post_type' => 'product', 'post_status' =>'publish', 'post__in' => array(1,2,3) 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'product_cat', 'field' => 'id', 'terms' => array( 103, 115, 206 ), 'include_children' => false, 'operator' => 'IN' ), ) $the_query = new WP_Query( $args );
    – huykon225
    Commented Mar 30, 2017 at 15:54
  • this is not an interrogation basement of the CIA ;) please put all relevant information in the question itself including expected results, actual results and whatever debuging efforts you have tried Commented Mar 30, 2017 at 16:47
  • I know it's illegal so I am looking for the solution. same my description, that's all
    – huykon225
    Commented Mar 31, 2017 at 1:49
  • it is your question.... you want an answer.... code in comments is unreadable, and question is unclear so if you are not going to improve the question there is less chance you will get good answer Commented Mar 31, 2017 at 4:18
  • sorry @MarkKaplun , please look at the question. I updated it
    – huykon225
    Commented Mar 31, 2017 at 7:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.