Support

Account

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; ?>" />
    }