Hi there.
I’m trying to pull a custom field that is a group — a link and a file, one or the other is filled out always.
I want to build a button on the results page that will pull either the link when filled out or the file download right on to the results. this is how its working on the single-posttype.php file: ` <?php if( have_rows(‘file_upload_or_direct_link’) ): ?>
<?php while( have_rows(‘file_upload_or_direct_link’) ): the_row();
$file = get_sub_field(‘file_upload’);
$url = get_sub_field(‘file_link’);
if( $file ): ?>
<a class=”articleFileDownload” href=”<?php echo $file[‘url’]; ?>”>Download PDF</a>
<?php endif; ?>
<?php if ($url): ?>
<a href=”<?php echo $url; ?>” class=”outwardLinkArticle” target=”_blank”>Follow Link to Access document</a>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>`
any suggestions on how to incorporate this into the $r->content; or otherwise just pull it in to the results page?
thanks,