Home › Forums › General Issues › Checkbox value conditional statement error › Reply To: Checkbox value conditional statement error
DOH! This is a repeater field, and this works:
`<?php
if(have_rows(‘project_areas’)):
while(have_rows(‘project_areas’)): the_row();
?>
<table>
<tr>
<td>Crash</td>
<td class=”align-center”>
<?php
if( get_sub_field(‘proj_crash’) ) {
if( in_array( ‘Timeliness’, get_sub_field(‘proj_crash’) ) )
{
echo ‘X’;
}}
?>
</td>
</tr>
</table>
<?php endwhile;
endif;
?>’
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.