Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Archaic Radio on "Query Multiple Taxonimies"

$
0
0

I'm ripping my hair out here. The code below works when I am querying two taxonomies but breaks when I add a third. Any help would be appreciated. Thanks.

$my_query = new WP_Query( array(
	'orderby' => 'rand',
	'posts_per_page' => 30,
	'post_type' => 'song',
	'tax_query' => array(
          'relation' => 'OR',
	   array(
	     'taxonomy' => 'band-name',
	     'terms' => $featband22,
	     'field' => 'term_id'
	   ),
	   array(
	     'taxonomy' => 'music-genre',
	     'terms' => $featgenre22,
	     'field' => 'term_id'
	   ),
	   array(
	     'taxonomy' => 'record-label',
	     'terms' => $featlabel22,
	     'field' => 'term_id'
	   ),
	)
));
if( $my_query->have_posts() ) {

Viewing all articles
Browse latest Browse all 8245

Trending Articles