First, you should not be needing to do a query if the template file name is taxonomy-location.php
. WP is already doing this query. You should simply need to do a loop over the posts
while (have_posts()) {
the_post();
}
How are the terms in this taxonomy added? Standard WP meta box or ACF custom field? If a custom field do you have save and load terms enabled?