Home › Forums › General Issues › Reverse order, get last row… › Reply To: Reverse order, get last row…
You initialize the counter before you’re loop. You put the if statement at the start of your loop. You increment the counter at the end of the loop.
This will show the first X items set by the if statement. Since you are reversing the order of the repeater this means it will show the last X items in reverse order. You can set X for whatever number you want to show. It will show up to that number, so if there are only 2 items then it would only show 2.
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.