Support

Account

Home Forums General Issues If statement with check box array Reply To: If statement with check box array

  • Paid to get the answer from somewhere else. Here it is for anyone wanting to do this: basically, if your ACF check box field is called “services_offered” and one of the services was “ac” then it would look like this:

    <?php
    
    				$values = get_field('services_offered');
    
    				if(in_array("ac", $values )){
    				?>
    				<div class="dealer-services-icon"><img src="<?php echo get_bloginfo('url'); ?>/media/icon-ac.png" alt="<?php the_field('focus_city'); ?> Air Conditioning Service" class="tooltips" title="Air Conditioning"></div>
    				<?
    				}
    
    				?>