tax_query in get_posts() not working?

tax_query takes an array of tax query arguments arrays (it takes an array of arrays) but you are using only single array. The correct code is as following. $uposts = get_posts( array( ‘post_type’ => ‘product’, ‘numberposts’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => $cat->taxonomy, ‘field’ => ‘slug’, ‘terms’ => array($cat->slug), ‘operator’ => ‘IN’, ) … Read more

custom post type taxonomy “tag” archive : no post found

Tag and Category archive queries default to querying only the post post type, to add your custom post type to those queries, you can use the pre_get_posts action: function wpa_cpt_tags( $query ) { if ( $query->is_tag() && $query->is_main_query() ) { $query->set( ‘post_type’, array( ‘post’, ‘object’ ) ); } } add_action( ‘pre_get_posts’, ‘wpa_cpt_tags’ );

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş