WooCommerce Products
// WP_Query arguments
$args = array(
'post_type' => array( 'product' ),
'post_status' => array( 'publish' ),
'nopaging' => true,
'order' => 'DESC',
'orderby' => 'title',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'brand',
'terms' => 'Duxone',
'field' => 'name',
),
),
);
// The Query
@aProducts = new WP_Query( $args );
// The Loop
if ( @aProducts->have_posts() ) {
while ( @aProducts->have_posts() ) {
@aProducts->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();