Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Tax query – spaceflight opinion OR nasa space

Retrieve items from the spaceflight category and the opinion section OR items tagged with Nasa and Space tags.

$tax_query = array(
	'relation' => 'OR',
	array(
		'taxonomy'         => 'tags',
		'terms'            => array( 'Nasa', 'Space' ),
		'field'            => 'name',
		'operator'         => 'AND',
	),
	array(
		'relation' => 'AND',
		array(
			'taxonomy'         => 'category',
			'terms'            => 'spaceflight',
			'field'            => 'slug',
		),
		array(
			'taxonomy'         => 'section',
			'terms'            => 'Opinion',
			'field'            => 'name',
		),
		array(
			'taxonomy'         => 'post_format',
			'terms'            => array( 'post-format-video', 'post-format-audio' ),
			'field'            => 'slug',
			'operator'         => 'IN',
		),
	),
);