Support

Account

Home Forums Bug Reports File doesn't appear to work inside a repeater Reply To: File doesn't appear to work inside a repeater

  • Ok, ok, in classic form you know how after a couple of hours of banging your head and then posting in support as a final cry for help you stumble across the obvious answer.

    Well, here it is in case anyone else is lost.

    You need to make sure “SUB” is added to the code like so:

    <?php if( get_sub_field('file') ): ?>
        <a href="<?php the_sub_field('file'); ?>" >Download File</a>
    <?php endif; ?>
    

    So add “get_sub_field” and “the_sub_field” and it will work. You need to add “sub” for repeaters and adjust the code inside accordingly.