Support

Account

Home Forums Add-ons Repeater Field the_repeater_field not working? Reply To: the_repeater_field not working?

  • This seems to work, thoughts?

    <?php if(get_field('media')): ?>
                    <div class="info news">
                      <ul>
                        <?php $rows = get_field('media'); ?>
                        <?php
                            $articleArray = array();
                            foreach( $rows as $key => $row ) {
                                $rows[$key] = $row['id'];
                                $articleArray[$key]['date'] = $row['date'];
                                $articleArray[$key]['file'] = $row['file'];
                                $articleArray[$key]['title'] = $row['title'];
                            }
                        ?>
                        <?php $rowCount = count($rows); ?>
                        <?php for ($i = ($rowCount - 1); $i >= 0; $i--) { ?>
                        <li>
                            <em><?php echo $articleArray[$i]['date']; ?></em>
                            <strong><a href="<?php echo $articleArray[$i]['file']; ?>" rel="bookmark"><?php echo $articleArray[$i]['title']; ?></a></strong>
                        </li>
                        <?php } ?>
                    </ul>
            </div>
            <?php endif; ?>