Home Forums Add-ons Flexible Content Field Repeater field not showing the closing HTML tag


Repeater field not showing the closing HTML tag

  • 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">
                            $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; ?>
                                    endif; ?>
                                    <?php echo  ' </div>' ?>
                            <?php endif; ?>

    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')) :
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.