「WordPress果酱」将通过一系列教程讲解如何使用 WP_Query 进行 WordPress 文章查询。...taxonomy (string) – 分类模式.
field (string) – 如何获取分类模式(Taxonomy term),可能的值有:「term_id」,「name」,「slug」或者「term_taxonomy_id...单个分类模式查询
在 people 这个自定义分类模式获取值为 bob 的文章:
$query = new WP_Query(array(
'post_type' => 'post',...people',
'field' => 'slug',
'terms' => 'bob',
),
),
));
多重分类模式查询...field' => 'slug',
'terms' => array( 'post-format-quote' ),
),
),
));
嵌套分类模式查询