Support

Account

Home Forums ACF PRO Check posts for Custom Field Reply To: Check posts for Custom Field

  • try something like this:

    <ul class="slider">
    <?php if( get_field('display_in_carousel') )
    {
    $image = get_field('image'); 
    if( !empty($image) ): ?>
    	<li><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /></li>
    <?php endif; 
    }
    else
    {
        //do nothing
    }
    ?>
    </ul>

    of course you need to wrap that like your slider need it (and probably change way of load image too)

    or you do it with meta-query like the other part of the example