Taxonomy query doesn’t work without terms
parameter. So you have to first query all the regions term then assign term ids to taxonomy query.
Here’s the solution –
$terms = get_terms( array(
'taxonomy' => 'regions',
'fields' => 'id=>slug',
) );
$args = array(
'orderby' => 'date',
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'regions',
'field' => 'term_id',
'terms' => array_keys( $terms ),
),
),
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
the_content();
}
wp_reset_postdata();
} else {
echo '<p>Sorry, there are no posts to display</p>';
}
Btw, you shouldn’t use wp_reset_query()
it’s costly and should be used with query_posts()
only instead use wp_reset_postdata()
.