Support

Account

Home Forums Add-ons Repeater Field Show a HTML tags and a variables into line PHP code

Solved

Show a HTML tags and a variables into line PHP code

  • Hi everyone!

    I try to show a code with the repeater feature in ACF Pro into a while bucle.
    My line code is the next:

    <?php
    if(have_rows('otros_archivos')):
    while ( have_rows('otros_archivos') ) : the_row();
    $antecedente = the_sub_field('antecedente');
    echo "<a href='".$antecedente."' target='_blank'> '".$antecedente."' </a><br/>";	
    endwhile;
    endif;
    ?>

    And this my line code with the mistake:

    echo "<a href='".$antecedente."' target='_blank'> '".$antecedente."' </a><br/>";

    The first variable $antecedente is shows, but no like a link and the second $antecedente shows this text: ”

    I would very much appreciate your help.

    Best regards from Chile.

    P.S.: I’m so sorry for my bad English lenguage, I’ll try to improve it someday.

    EDITED

    This is my edited code that works finally!!:

    `<?php if(have_rows(‘otros_archivos’)):
    while ( have_rows(‘otros_archivos’) ) : the_row(); ?>
    <a href=”<?php the_sub_field(‘antecedente’); ?>” target=”_blank”><?php the_sub_field(‘antecedente’); ?></a><br/>
    <?php endwhile; ?>
    <?php endif; ?>`

Viewing 1 post (of 1 total)

The topic ‘Show a HTML tags and a variables into line PHP code’ is closed to new replies.