Home › Forums › Add-ons › Repeater Field › Repeater fields reverse order › Reply To: Repeater fields reverse order
What you need to do is know how many rows are in the repeater and loop through it without doing anything until you get to the last one.
if (have_rows('dizi_sezon_1')) {
// use get_post_meta
// it will return the number of rows in the repeater
$row_count = intval(get_post_meta($post->ID, 'dizi_sezon_1', true));
$i = 0;
while (have_rows('dizi_sezon_1')) {
$i++;
if ($i<$row_count) {
continue;
}
// will only get here on the last row
// put code here to display row
}
}
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.