Home › Forums › Add-ons › Repeater Field › Populate Repeater Field with the number of posts per year › Reply To: Populate Repeater Field with the number of posts per year
You could do this by doing a query based on the date field, there are examples of this available. Then if you have a repeater somewhere, like on an options page, you can add rows to that repeater.
But this sounds a little complicated to me to track how many posts there are per year. I would more than likely create a WP options value that contains an array and track how many posts are created for each year as they are created or updated. If I need to do this retroactively then I’d find a way to get and populate this list and then start adding to it.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.