I've added a value to $old_pdf1
, var dumped it to test and yep it's there. So I then added the elseif statement but now it will no longer show.
If I var_dump before the elseif statement it shows the URL I want, if I put it at the end it doesn't return anything.
<?php
$old_pdf1 = get_field('old_pdf_file_1');
if( have_rows('pdf_files') ): ?>
<ul>
<?php while( have_rows('pdf_files') ): the_row(); ?>
<li><?php the_sub_field('case_study_pdf'); ?></li>
<?php endwhile; ?>
</ul>
<?php
elseif( !empty($old_pdf1) ):
the_field('old_pdf_file_1');
?>
<?php endif; ?>