Home › Forums › Add-ons › Repeater Field › How to make File repeater › Reply To: How to make File repeater
Some of the basic stuff like this is explained in the file field documentation http://www.advancedcustomfields.com/resources/file/
If you want to see everything that’s returned for the file try doing the following in your code where you’re getting the value
$file = get_sub_field('file_upload');
echo '<pre>'; print_r($file); echo '</pre>';
Here is how you show the file name
<?php
if (have_rows('file_repeater')) {
while (have_rows('file_repeater')) {
the_row();
$file = get_sub_field('file_upload');
?>
<br>
<img style="width:18px; height:10px;" src="http://www.subshunter.com/wp-content/uploads/2016/01/br.png" />
<span><?php echo $title; ?></span>
<a href="<?php echo $file['url']; ?>"><?php echo $file['filename']</a>
<?php
}
}
?>
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.