I am trying to hide a container div if the fields within it have no value. The fields themselves aren’t a problem. If they have no value they aren’t displayed. But if I add padding to the container div it shows up on the page. How can I hide it completely?
Here’s my code –
<div class=”transform-txt-block-1″ style=”background-color:aquamarine”>
<?php if($block[‘title’]){
echo ‘<h4 class=”h5″>’.$block[‘title’].'</h4>’;
}
if($block[‘short_description’]){
echo $block[‘short_description’];
} ?>
</div>
<div class=”transform-txt-block-2″ style=”background-color:bisque”>
<?php if($block[‘title_2’]){
echo ‘<h4 class=”h5″>’.$block[‘title_2′].'</h4>’;
}
if($block[‘short_description_2’]){
echo $block[‘short_description_2’];
} ?>
</div>