Home › Forums › Add-ons › Repeater Field › Get Data from Last Row in Repeater › Reply To: Get Data from Last Row in Repeater
Thanks, that’s insanely easy compared to the documentation and other examples I found!
Admittedly this is more of a PHP issue than ACF so I’ll understand if this next question goes unanswered! One thing that’s tripping me up is using the advanced image vars. How do I use the $last_row variable in conjunction with the image title, alt, size vars? My attempt with ‘url’ was unsuccessful 🙂
if ( $last_row['pod_image'] ) {
$url = $last_row[ $pod_image['url'] ];
$title = $pod_image['title'];
$alt = $pod_image['alt'];
// thumbnail
$size = 'medium';
$thumb = $pod_image['sizes'][ $size ]; ?>
<img src="<?php echo $thumb; ?>" alt="<?php echo $alt; ?>" />
}
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.