Home Forums Add-ons Repeater Field 'if repeater field if empty else { …. }' doesn't work Reply To: 'if repeater field if empty else { …. }' doesn't work

  • Hello zwaarcontrast,

    Than you for your reply.

    I tried similar code and worked.

    I think the problem is when I check if the field ‘‘file’ is not empty to not show it in this case.

      $link = get_sub_field(‘file’);
      $name = get_sub_field(‘file_name’);
      <?php if( $link ): ?>
      <a href=”<?php echo $link; ?>” target=”_blank”> <?php echo $name; ?>
      <?php endif; ?>

    Are you sure there are no downloads present?

    Yes, I am.

    When There is a attached file look like this:
    with files

    and when there is not files look like this:
    white file

    It’s strange because I don’t have any error in my error log also the debug of WP and my server is ON so.. I don’t know exactly what is the problem.

    Thank you!