Home › Forums › Add-ons › Repeater Field › Using get_post_meta as Fallback on Repeaters › Reply To: Using get_post_meta as Fallback on Repeaters
tried to this using
$rows = get_post_meta( 348, 'testimonials', false ); // get number of rows (8 but in a array)
$row_count = $rows[0]; //get row number out of array (8)
echo $row_count--; // because first row start with 0 not 1 subtract one from row number (8-1 =7)
//now you could use $row_count to get last row (7)
$lastrow = 'testimonials_'.$row_count.'_testimonial'; //you need to replace echo by a variable and use that
echo $lastrow;
What i get front end is
8testimonials_7_testimonial
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.