如果文章有些没有使用标签(tag),自己忘记了,可以使用 WP_Query
的 tax_query
参数来实现:
$untagged_query = new WP_Query([ 'post_status' => 'publish', 'tax_query' => [ [ 'taxonomy' => 'post_tag', 'field' => 'id', 'operator' => 'NOT EXISTS' ] ] ]);
如果文章有些没有使用标签(tag),自己忘记了,可以使用 WP_Query
的 tax_query
参数来实现:
$untagged_query = new WP_Query([ 'post_status' => 'publish', 'tax_query' => [ [ 'taxonomy' => 'post_tag', 'field' => 'id', 'operator' => 'NOT EXISTS' ] ] ]);