ACF Repeater Loop

@besim could you clarify what you mean by this? I’m not sure what you mean when you refer to “rows” or what exactly an “ACF array” is. I assume you mean that you have an ACF repeater field and you’re able to limit your loop to one item in the repeater field using count but you’re not able to limit your loop to two or three items. Is that right?

@avanti Query parameters are loop-type-specific, so I’m not sure that query parameters from the post loop type like exclude are even supposed to work on an ACF relationship loop type (or a repeater loop type for that matter). I think the idea here is that an ACF relationship field is simply a list of posts, it’s not a query, which means you can’t filter it because it’s simply looping through the posts you’ve defined in the relationship field. Same idea with the repeater field, L&L isn’t querying data, it’s just looping through the information in your field. It is possible to sorta “convert” an ACF relationship loop into a post loop, at which point it actually is querying your posts and you’ll be able to use all the query parameters from the post loop type.

<Loop type=post post_type=post include="{Field acf_relationship_field_name}">

That being said, I’m not sure if the specific exclude parameter would work because then you’d effectively be saying “loop through these specific posts, but also don’t loop through this same post I’ve already told you to loop through” which doesn’t work logically. Might still work though so it’s worth a try. Failing that, maybe you could achieve that with something like this:

<Loop type=post post_type=post include="{Format replace=123 with=''}{Field acf_relationship_field_name}{/Format}">

Maybe there’s a better way to work with the Format tag so you’d have to tinker around with that, but I think you get the idea. I’m not sure this is a bug so much as a logical limitation that’s not fully explained in the documentation. I imagine you could approach this the same way with a repeater field, it would just depend how your repeater is set up and what fields you’ve defined inside it.

In any case, we definitely need to improve the ACF page of the docs to clarify this.