Home › Forums › General Issues › Unable to display tax_query › Reply To: Unable to display tax_query
Yes, I saw that. I must not have used it correctly. If you don’t mind looking at it the current code is below> Thanks again.
<?php $args = array(
‘post_type’ => ‘properties’,
‘tax_query’ => array(
array(
‘posts_per_page’ => -1,
‘taxonomy’ => ‘property_type’,
‘field’ => ‘slug’,
‘terms’ => ‘retail’
),
),
);
$query = new WP_Query( $args );
while ( $query->have_posts() ) : $query->the_post(); ?>
<?php
$term = get_queried_object();
$property_address = get_field(‘property_address’,$term);
echo $property_address;
?>
<?php the_title();?>
<h2 class=”prop-address”><?php the_field(‘property_address’); ?></h2>
<p class=”prop-description”><?php the_field(‘property_description’); ?></p>
<?php endwhile; ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.