Hi all,
I have a problem with downloading the files, which are added via file field in ACF Pro. They show correctly on front-end, but only doc files are downloaded when clicked, other files types (jpg, png, pdfs) are just opening inside the browser. How to make all the files downloadable? The code I use:
<?php
// check if the repeater field has rows of data
if( have_rows('repeater_field') ):
// loop through the rows of data
while ( have_rows('repeater_field') ) : the_row();
// display a sub field value?>
<div class="file-row">
<a href="<?php the_sub_field('repeater_subfield'); ?>" >Download file</a>
</div>
<?php
endwhile;
else :
// no rows found
endif;
?>
Thanks for your help!
Hey!
Two solutions to make it easier fot the front-end user:
1- open the link in a new tab.
2- put all your files in an archive.