The easiest way I can see is to gather a list of the terms in that taxonomy, and use them with a NOT IN
operator in your query’s tax_query
:
// Get all the terms in your custom taxonomy.
$slugs = get_terms( [
'taxonomy' => 'industry',
'fields' => 'slugs',
] );
$posts = query_posts( [
'post_type' => 'post',
'posts_per_page' => 4,
'post_status' => 'publish',
'tax_query' => [
[
'taxonomy' => APP_TAX_STORE,
'operator' => 'NOT IN',
'field' => 'slug',
'terms' => $slugs,
]
]
] );
I would suggest reading up on query_posts if you haven’t already – heed the warning that it could cause confusion and trouble down the road. get_posts
should get you the same results without the burden of overwriting the main query.