Hiding Sub Field

On a repeater field, we want to hide sub field that dont have any value.
Here’s the code

<?php
	$showvideo = get_sub_field('video');
	if(!empty($showvideo)){ ?>
	<div class="galleryItem">
		<div class="embed-container">
			<?php the_sub_field('video'); ?>
		</div>
	<div>
<?php }	?>

Leave a Reply

Your email address will not be published. Required fields are marked *