Advanced custom fields plugin.

Display ACF select field

<?php
// vars 
$colors = get_field('test_select');
 
// check
if( $colors && in_array('select1', $colors) ): ?>
<p>SELECT 1</p>
<?php elseif( $colors && in_array('select2', $colors) ): ?>
<p>SELECT 2</p>
<?php elseif( $colors && in_array('select3', $colors) ): ?>
<p>SELECT 3</p>
<?php elseif( $colors && in_array('select4', $colors) ): ?>
<p>SELECT 4</p>
<?php else: ?>
 <p> NOTHING SELECTED</p>
<?php endif; ?>

Contact me.

I would love to hear from you, send me a message using the form below.

    ×