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; ?>
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.