woocommerce - Wordpress - display posts from a specific custom taxonomy and a certain tag -


i need tax_query assigned specific custom category , tags. below query showing products need products particular category.

here tag="sale", category="look"

$args = array(     'post_type' => 'product',     'tax_query' => array(         'relation' => 'and',         array(             'taxonomy' => 'product_cat',             'field'    => 'slug',             'terms'    => array( 'look' ),         ),         array(             'taxonomy' => 'product_tag',             'field'    => 'slug',             'terms'    => 'sale',         ),     ), );  $query = new wp_query( $args ); 

you can use

$new = new wp_query('category_name=look&tag=sale'); 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -