php - Using 'post_type' => 'product' in woocommerce -
i have woocomemce site , products have "manufacturer" attribute.
when terms single product :
$terms= get_the_terms($product->id,"pa_manufacturer");
i :
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 ) )
can loop wp_query term_id products same manufacturer? how can products specific term_id?
here test, not working...
$args = array( 'post_type' => 'product', 'term_id' => 230 , 'posts_per_page' => 2, 'orderby' => $orderby ); $loop = new wp_query( $args ); // stuff here display products
any help appreciated, thanks.
your problem in query. term_id not available argument wp_query. here list of available arguments. got list http://phporlando.com/wp_query-argument-list/
attachment attachment_id author author_name cat category__and category__in category__not_in category_name comments_popup day error feed hr min monthnum name order orderby page_id page paged pagename post__in post__not_in post_status post_type preview robots sentence sec static subpost subpost_id tag__and tag__in tag__not_in tag_id tag_slug__and tag_slug__in tag taxonomy - (pre 3.1) tb term - (pre 3.1) w withcomments withoutcomments year pre wp 3.1 meta_key meta_value since wp 3.1 fields meta_query tax_query php wordpress woocommerce
No comments:
Post a Comment