title: Show Advanced Custom Fields repeater child field only when it exists in the post
body: <p>I am using a repeater field to show products on a page. Some of these require a PDF download link and some don't. I need to be able to show the "Download PDF" link only when a PDF has been uploaded to the file upload repeater child field.</p>
  
  <p>Here's what I'm working with so far:</p>
  
  <pre><code>&lt;?php 
              $rows = get_field('artwork_example');
              if($rows) {
                  foreach($rows as $row) {
                      echo '&lt;div class="artwork-content"&gt;&lt;img src="', $row['image'];
                      echo '"&gt;&lt;div class="right"&gt;&lt;h2&gt;', $row['title'];
                      echo '&lt;/h2&gt;&lt;p&gt;', $row['text'];
                      echo '&lt;/p&gt;';
                      if ( get_sub_field('upload_pdf') ) echo '&lt;p&gt;&lt;a class="download" href="', $row['upload_pdf'];
                      if ( get_sub_field('upload_pdf') ) echo '"&gt;Download PDF&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;'; 
          } 
      }
  ?&gt;
  </code></pre>
  
  <p>Any help appreciated, thanks!</p>