Home › Forums › ACF PRO › Hide repeater Sub Fields › Reply To: Hide repeater Sub Fields
it is possible, just check if value is there
but for that you need to re-arrange / re-write your code.
here a part of it. just add the other rows the same way.
<?php if( have_rows('model_specifications') ):
while( have_rows('model_specifications') ): the_row();
$ms_model = get_sub_field('model');
$ms_gpm = get_sub_field('gpm');
endwhile;
echo '<div id="model-specifications">';
echo '<dl>';
if ($ms_model) {echo '<dt class="model">Model</dt>';}
if ($ms_gpm) {echo '<dt class="gpm">GPM</dt>';}
if ($ms_model) {echo '<dd class="model">'.$ms_model.'</dd>';}
if ($ms_gpm) {echo '<dd class="gpm">'.$ms_gpm.'</dd>';}
echo '</dl>';
?>
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.