Home › Forums › Add-ons › Repeater Field › If Elseif Else Question › Reply To: If Elseif Else Question
Try this:
<?php
if(get_field('pdf_paris')){
$pdfParis = get_field('pdf_paris');
echo'<h2><a href="'.$pdfParis.'" target="_blank">Download <br />the PDF for Paris</a></h2>';
else if(get_field('pdf_marseille')){
$pdfMars = get_field('pdf_marseille');
echo'<a href="'. $pdfMars.'" target="_blank">Download <br />the PDF for Marseille</a>';
else {
echo'No PDF available.';
}
?>
Have fun!
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.