ben-g
9/12/2017 - 7:21 PM

Hiding Sub-fields if they are empty.

			<?php while ( have_rows('salaries') ) : the_row();
					$salary_name = get_sub_field('salary_name');
          $salary_amount = get_sub_field('salary_amount');
					$salary_description = get_sub_field('salary_description');
				?>
					<table class="salary" data-description="<?php the_sub_field('salary_description'); ?>">
						<?php if( $salary_name): ?>
						<tr>
							<th>
								<?php the_sub_field('salary_name'); ?>
							</th>
						</tr>
						<?php endif; ?>
						<?php if( $salary_amount ): ?>
						<tr>
							<td>
								<?php the_sub_field('salary_amount'); ?>
							</td>
						</tr>
						<?php endif; ?>
					</table>

				<?php endwhile; ?>