Hello! I have an issue with a repeater field nested in a Flexible Content Field where I want to dynamically change the value of bootstrap col class depending on how many times the repeater field was used. However, my code doesn’t display the closing anchor tag “” in the front-end. Any ideas on why this might be happening? Thanks in advance!
<?php elseif (get_row_layout() == 'dodaj_dugme_za_skidanje_fajla') :
?>
<div class="row mb-3">
<?php
$repeater_field = get_sub_field('dugme_za_skidanje_fajla');
if (have_rows('dugme_za_skidanje_fajla')) :
while (have_rows('dugme_za_skidanje_fajla')) : the_row();
$text = get_sub_field('tekst_dugmeta');
$file = get_sub_field('fajl');
$count = count($repeater_field);
?>
<?php if ($count > 1) : ?>
<?php echo '<div class="col-', (12 / $count), ' py-3 text-center mb-5>'; ?>
<a href="<?php echo $file; ?>">
<?php echo $text; ?>
</a>
<?php
endif; ?>
<?php echo ' </div>' ?>
<?php
$count++;
endwhile;
?>
<?php endif; ?>
</div>
I tried wrapping my a tag with a button tag, but then the closing </button> tag doesn’t work
There is not matching endif;
for this ‘if`
if (have_rows('dugme_za_skidanje_fajla')) :