Home › Forums › ACF PRO › If next date in loop… › Reply To: If next date in loop…
It’a more or a general PHP/WP question.
It looks like you are setting every “tab” to active. Basically, if you have you posts ordered so that they are all in the future then the first one will always be the soonest event. You already have a counter so I think this should work
<?php if ($counter == 0) { echo 'active'; }
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.