Support

Account

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>';
    ?>