0 points

Simple Taxonomy Query:


dashboard

Thu Oct 01 2020 20:29:15 GMT+0000 (UTC)

Posted by @rstringa #wordpress #query #taxonomie

Simple Taxonomy Query:

Display posts tagged with bob, under people custom taxonomy:

$args = array(
	'post_type' => 'post',
	'tax_query' => array(
		array(
			'taxonomy' => 'people',
			'field'    => 'slug',
			'terms'    => 'bob',
		),
	),
);
$query = new WP_Query( $args );
content_copy Copy

http://man.hubwiz.com/docset/WordPress.docset/Contents/Resources/Documents/codex.wordpress.org/Function_Reference/WP_Query.html