Display 1 custom post type by a custom taxonomy not working
So the idea here is I have multiple products (CPT) and a custom taxonomy named Feature. It’s a radio button field with Yes/No option. I want to display 1 random featured product on front page. But somehow it didn’t work, what did I do wrong?
<?php $args = array( 'post_type' => 'product', 'orderby' => 'rand', 'posts_per_page' => 1, 'tax_query' => array( array( 'taxonomy' => 'product_feature', //CPT Name 'field' => 'product_feature_field', //Field Name 'terms' => array( 'product-feature-yes' ) //Taxonomy Slug ), ) ); $new_query = new WP_Query( $args ); ?>