I have a register form which is build with flexible content.
The first while loop, loops through flexible content elements.
The second loop (which is inside the first loop) is looping through a repeater field, and within the while loop there is another repeater field with it’s own loop (the third loop).
(The second loop will loop 3 times on my website because of the content I added in ACF fields in WordPress).
The third loop produces a list of hyperlinks. The third loop will loop 4 times to get all the links.
Now here comes the tricky part:
– I want to have a condition surrounding the third loop, to produce links only once. (at the moment without the condition, it will loop 3 times which results in creating 12 links instead of 4). (Maybe a dynamic counter of some sort is part of the answer?).
– Then when the ‘second loop’ runs for a second time, the third loop skips the first results of the loop (the first 4 links) and fetches the results row after that, and than stops/breaks the (third) loop, producing another 4 fresh links.
– When the second loop runs a for a third time, it should again fetch the results row thereafter from the previous loop (just like above). etc.
Yes, I know it’s confusing, but I really need this.