Array within an Array > Multiple Taxonomy Queries!

<?php
	
	global $post; 							 							
	$current = get_the_terms($post->ID,'area'); 							
	$current = array_values($current);  							 							 							//print_r($current);
	$args = array( 								
		'post_type' => 'agents', 								
		'posts_per_page' => -1,
		'orderby' => 'title',
		'order' => 'ASC',
		'tax_query' => array(array(
			'taxonomy' => 'area',
			'field' => 'slug',
			'terms' => $current[0]->slug,
		))
	);
	$current_area = get_posts($args);
	
	foreach($current_area as $post) : setup_postdata($post); ?>
		<li><?php the_post_thumbnail(); ?> 								
			<h2><?php the_title(); ?></h2>
			<?php the_content(); ?>
		</li>
	<?php
	endforeach; wp_reset_postdata();

 

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.