0
나는 우물 사이트를 가지고 있으며 제품에 "제조업체"속성이 있습니다.woocommerce에서 'post_type'=> 'product'사용
내가 단일 제품에 대한 조항 얻을 :
$terms= get_the_terms($product->id,"pa_manufacturer");
내가 얻을 :
Array ([230] => stdClass Object ([term_id] => 230 [name] => Dadawan [slug] => dadawan [term_group] => 0 [term_taxonomy_id] => 230 [taxonomy] => pa_manufacturer [description] => [parent] => 0 [count] => 4 [object_id] => 2905))
난은 같은 제조업체에 제품을 얻을 수있는 그 term_id와 루프 WP_query을 할 수 있습니까? 특정 term_id의 제품 만 가져 오려면 어떻게해야합니까? 여기
내 테스트입니다,하지만 ...$args = array(
'post_type' => 'product',
'term_id' => 230 ,
'posts_per_page' => 2,
'orderby' => $orderby
);
$loop = new WP_Query($args);
// Do stuff here to display your products
감사 어떤 도움 덕분에 작동하지 않습니다.