Support

Account

Home Forums Add-ons Repeater Field Repeater field items reference post object – how to filter items by post object?

Helping

Repeater field items reference post object – how to filter items by post object?

  • I have a repeater field that references a post object (i.e. a home listing that references a builder). I want to be able to filter by each post object (i.e. which builder). I know that I can loop through the repeater and use an if statement to check if the subfield (in my case a post object) is equal to whatever I have in my querystring, but I figured there may be a better approach.

    Here is a screencap of my setup:
    ACF repeater example

    Would I be better off using another field type, relationship maybe?

  • Hi @jonnyme,

    Thanks for the post.

    I don’t think there is real much difference in terms of queries when you use a Post Object field or a Relationship field.

    The query will take the same approach and thus you can go with your original implementation of comparing the post object(builder).

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Repeater field items reference post object – how to filter items by post object?’ is closed to new replies.