jeremy-h of Web Development
11/9/2017 - 6:50 PM

Advanced Custom Fields - Conditional

<?php 
    $args = array(
        'posts_per_page' => 1,
        'post_type' => 'whitepaper',
        'tax_query' => array(
            array(
                'taxonomy' => 'whitepaper_tag',
                'field' => 'term_id',
                'terms' => get_field('whitepaper'),
            )
        )
        );
            query_posts( $args );
            while ( have_posts() ) : the_post();
        ?>
                    
        <!-- HTML here -->
                    
    <?php endwhile; ?>
    <?php wp_reset_query(); ?>