Support

Account

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; ?>