I'm making a WordPress theme and using Advanced Custom Fields I have added a repeater option.
Now the thing is I want to allow the user to add as many "services" as they want but I am not sure how to make this so that bootstrap grids are dynamically created based on the number of services.
I saw this question: Using PHP loop to add Bootstrap rows and proper column numbers to elements But couldn't figure out how to use it properly with what I need.
What I tried was counting the number of services and returning the html from that function.
Then I made a str_replace_first_occurance
function that basically did an str_replace
on the first occurrence of "Content". And it looped through this the number of services there were.
I guess this should've worked but it became very messy and doesn't seem like the best way to do this.
What's the best way to achieve this?