Home › Forums › Pro Support › Custom Field repeater/URL output › Reply To: Custom Field repeater/URL output
August 2, 2018 at 5:07 pm
#5546
Keymaster
Hi there,
Give this a shot instead:
add_action( 'wpsp_after_content', 'tu_add_material' );
function tu_add_material() {
if ( have_rows( 'related_material' ) ) :
while( have_rows('related_material') ): the_row();
$link = get_sub_field('link');
if ( $link ) : ?>
<a class="related-material" href="<?php echo $link['link']; ?>" target="<?php echo $link['target']; ?>"> <?php echo $link['title']; ?> </a>
<?php endif;
endwhile;
endif;
}