Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Displaying ACF Image Galleries and Repeater Fields in Query Loop

  • Hi,

    Is it possible to display both an ACF image gallery and an ACF repeater field within a GenerateBlocks 2.0 Query Loop without needing to write any additional custom code? If so, could you show me how to set it up?

    Thank you.

  • Hi there,

    It should be able to, but I haven’t tested it yet myself.

    What it the relationship between the gallery and the repeater? Is the gallery a sub field of the repeater?

    Or you can provide your admin login for me to check the structure.

    Let me know 🙂

  • Hi

    Sorry for the confusion. What i meant is two separated questions

    1. I made a Content Template element for a CPT and want to use Text element or Image element to display all images from an ACF gallery field. Is it possible?

    2. I also have ACF repeater fields in this CPT so how to display all repeaters content including its subfields?

    Thank you

  • Hi there,

    Both fields are now supported in the V2 Query block. Here’s how to configure them correctly:

    ACF Gallery field:
    – Add a Query Loop block, set the Query Type to Post Meta, and enter the gallery field name in the Meta Key field.
    – Inside the Loop Item block, add an Image block and use the dynamic tag {loop_item key:url} in the Image field.

    ACF Repeater field:
    – Add a Query Loop block, set the Query Type to Post Meta, and enter the repeater field name in the Meta Key field.
    – Inside the Loop Item block, add a Text block for each subfield within the repeater. Use the dynamic tag {loop_item key:subfield_name} (replace subfield_name with the actual subfield name). For multiple subfields, add corresponding Text blocks for each.

  • Thank you very much it’s working.

    I have another scenario using query loop to to display Room CPTs inside Content Template of a Cruise CPT.

    Inside each Room block, i also need to display room images (ACF gallery field). Is it doable?

    Looks like i need a nested query loop inside?

  • Yes, in this case, you need to add another Query block for the Gallery field inside the Room Query block.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.