I'm trying to add col-lg-6 to one of the Divs when no content is being displayed for name3 and name4, but it keeps showing as col-lg-4.
<?php
$name3 = get_field( 'name3', $post->ID );
$name4 = get_field( 'name4', $post->ID );
?>
<div class="col-lg-3">
<!-- name1 exists -->
</div>
<?php if($name3 == "" || $name4 == ""): ?>
<div class="col-lg-4">
<?php elseif($name3 == "" && $name4 == ""): ?>
<div class="col-lg-6">
<?php else: ?>
<div class="col-lg-3">
<?php endif; ?>
<!-- name2 exists -->
</div>
<div class="col-lg-3">
<!-- name3 does not exist -->
</div>
<div class="col-lg-3">
<!-- name4 does not exist -->
</div>
I've looked on here and other sites but I just can't figure it out. I know it's probably going to be something stupid and simple but I really need to sort this out now.
Aucun commentaire:
Enregistrer un commentaire