Home › Forums › Add-ons › Repeater Field › PDF Attachment as Link › Reply To: PDF Attachment as Link
Hi @hartu
Could you please tell me where did you want it to show up?
If it’s on the front end, I believe you can add a new file custom field to the repeater and then add the link to the job text like this:
<?php
// check if the repeater field has rows of data
if( have_rows('repeater_field_name') ):
// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();
// display a sub field value
$file = get_sub_field('file_sub_field');
if( $file ):
?>
<a href="<?php echo $file['url']; ?>"><?php the_sub_field('job_sub_field'); ?></a>
<?php endif;
endwhile;
else :
// no rows found
endif;
?>
I’m afraid you can’t do it on the backend, though. I’m sorry for the inconvenience.
I hope this helps 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.