# How to use ACF repeater with Pinegrow?

**URL:** <https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158>\
**Category:** Pinegrow WP\
**Created:** [March 25, 2021, 2:48pm UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158 "2021-03-25T14:48:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![beatngu](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@beatngu](https://forum.pinegrow.com/u/beatngu)\
**Post date:** [March 25, 2021, 2:48pm UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/1 "2021-03-25T14:48:41Z")

</div>

Hi there ,  
I asked a while back if anyone knew how to use the ACF repeater in the gutenberg blocks but i did not get a answer so i’m trying again.

Have tried a lot of time to get this working but i just can’t get it working.  
Not sure what to use in pinegrow to select the element that needs to be repeated.

The most logical way would be to select the element in my case a col-md-4 and add post field with a id.

Then the id is used in ACF as field name on the repeater and adding some more post fields on the content such as title and description and giving them a id and using the title and description id in the repeater.

However this does not work for me i only get a text with Array in wordpress.

This as been bugging me for a long time now and it would be nice to get a answer if it’s even possible to use ACF repeater in combination with blocks in pinegrow with the current actions.

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [March 25, 2021, 3:27pm UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/2 "2021-03-25T15:27:39Z")

</div>

Hey @beatngu,  
Can you give me a little more detail on what you are trying to achieve at the end? Somehow this isn’t quite clicking in my mind. Are you accessing an existing repeater field on the front-end, or …  
Thanks,  
Bob

---

<div class="post-metadata">

**Author:** ![Roel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/roel/32/1753_2.png) [@Roel](https://forum.pinegrow.com/u/Roel)\
**Post date:** [March 25, 2021, 3:42pm UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/3 "2021-03-25T15:42:20Z")

</div>

Take a look at my answer in this thread. I think it’s exactly what you are looking for.

[ACF repeater fields in Gutenberg blocks - Blocks - Pinegrow Community Forum](https://forum.pinegrow.com/t/acf-repeater-fields-in-gutenberg-blocks/3998)

---

<div class="post-metadata">

**Author:** ![beatngu](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@beatngu](https://forum.pinegrow.com/u/beatngu)\
**Post date:** [March 25, 2021, 9:50pm UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/4 "2021-03-25T21:50:15Z")

</div>

Thanks Roel!  
Not was i was hoping for but i guess this is better then nothing , wish pinegrow had better implementation.

I must be doing something wrong with your solution , managed to repeat the columns but the content is not repeated with the text i enter in the gutenberg fields.

On the title and description in my column i added a post field for the title and one for the description or do i need to do something else?

Was following this [ACF | Repeater (advancedcustomfields.com)](https://www.advancedcustomfields.com/resources/repeater/)

And i thought i could just handle the get\_sub\_field with a post field action from pinegrow but i may be wrong.

Maybe better to include the code on how it currently looks

\<?php if( have\_rows('page\_services\_block') ):while( have\_rows('page\_services\_block') ) : the\_row(); ?\>

```
<div class="col-md-4" data-aos="fade-up" data-aos-delay="0">
    <div class="service service-style-2">
        <i class="fas fa-laptop-code text-primary"></i>
        <h5 class="service-title"><?php echo get_field( 'page_service_title' ); ?></h5>
        <span class="service-text"><?php echo get_field( 'page_service_desc' ); ?></span>
    </div>
</div>

```

\<?php endwhile; else : endif; ?\>

---

<div class="post-metadata">

**Author:** ![Roel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/roel/32/1753_2.png) [@Roel](https://forum.pinegrow.com/u/Roel)\
**Post date:** [March 25, 2021, 10:15pm UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/5 "2021-03-25T22:15:35Z")

</div>

As you can see in the code, the post field action you used is implementing “get\_field”. This will not work within a repeater. As you pointed out yourself you’ll need to use “get\_sub\_field” and as far as I know the only way to do that is to use a PHP code action and write the whole echo manually (you can use the checkbox but in the below example I opted not to…).

Like this:

![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/4/4802e21e377ce689fa1bf0573ccb41c5a6df2ec0.png)

ps: to be complete: the code inside the field in the above image looks like this:  
_echo get\_sub\_field(‘subheading’);_

---

<div class="post-metadata">

**Author:** ![beatngu](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@beatngu](https://forum.pinegrow.com/u/beatngu)\
**Post date:** [March 25, 2021, 10:17pm UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/6 "2021-03-25T22:17:44Z")

</div>

Hi Bob,  
I am making a site modular with just gutenberg blocks so my clients can edit them easily.  
Have a section with 6 columns with a icon , title and description and i want to use the ACF repeater.

If it’s always just going to be 6 columns i could just make 6 editable columns in the block editor.  
However if my clients want to add more columns they can’t because it’s fixed at 6 columns and with a repeater you can add as many as you want.

Say you have a section with team members and you have 6 members to start with but after a while you hire another 3 members.I would then need to update the site for my client because it’s a fixed set of columns without the repeater but if i do it with the repeater my client can just click add row in the repeater and i do not need to do anything.

---

<div class="post-metadata">

**Author:** ![beatngu](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@beatngu](https://forum.pinegrow.com/u/beatngu)\
**Post date:** [March 25, 2021, 10:43pm UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/7 "2021-03-25T22:43:48Z")

</div>

Thanks for trying to help Roel.  
Awesome Roel i got it working 🙂

---

<div class="post-metadata">

**Author:** ![Roel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/roel/32/1753_2.png) [@Roel](https://forum.pinegrow.com/u/Roel)\
**Post date:** [March 25, 2021, 10:52pm UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/8 "2021-03-25T22:52:20Z")

</div>

No problem, happy to help!

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [March 26, 2021, 7:26am UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/9 "2021-03-26T07:26:38Z")

</div>

@Roel @beatngu Because not all situations can be easily handled (only) with standard smart actions, we cover the special cases of WordPress development in this chapter of our dedicated WordPress FAQ:

> **[FAQ about creating WordPress themes with Pinegrow | Pinegrow Web Editor](https://pinegrow.com/docs/wordpress/faq-about-creating-wordpress-themes-with-pinegrow/#as-an-experienced-web-designer-as-well-as-a-wordpress-theme-creator-i-fancy-the-idea-of-creating-themes-visually-still-i-have-some-rather-complex-needs-that-i-dont-think-are-covered-by-the)**
>
> Let’s face it, although made super easier by the use of Pinegrow or Pinegrow Theme Converter for WordPress, the creation of a custom WordPress theme remains a complex task…

It requires a little more investment and understanding of how WordPress and PHP work, but it is well worth it to integrate complex features.

At the end of the story, everything is possible 🙂

---

<div class="post-metadata">

**Author:** ![beatngu](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@beatngu](https://forum.pinegrow.com/u/beatngu)\
**Post date:** [March 26, 2021, 8:45am UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/10 "2021-03-26T08:45:59Z")

</div>

It would be awesome to get more information in that wordpress section about more things that’s not possible out of the box with pinegrow and how to solve them with extra php and such.

I am a .net developer and not a php developer and i was very close with getting this to work with the php action in pinegrow with having a look at the documentation on ACF about the repeater but i messed up with the formatting of the code that goes in to the php code action in pinegrow.

I certainly have no problem with looking at documentation about various things but i feel pinegrow could use some more use examples on certain wordpress actions.

What i am saying i can see what the various of php code does but my main problem is how to use them in pinegrow so i think it would help a lot of users to see how it it’s added in pinegrow so they can just copy past wordpress php code from various of places.

Also i want to ask this , is it possible to add the making of block patterns in pinegrow without the use of ACF?

I have looked at the documentation of the block api and with a quick look it looks like it’s working a bit like custom posts. [Block Patterns | Block Editor Handbook | WordPress Developer Resources](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns/)

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [March 26, 2021, 9:37am UTC](https://forum.pinegrow.com/t/how-to-use-acf-repeater-with-pinegrow/5158/11 "2021-03-26T09:37:10Z")

</div>

@beatngu Message heard.

Long before the arrival of smart actions with ACF support, I had written this document **which is still a good inspiration** for understanding what is possible with Pinegrow: [How to use ACF Pro Flexible Content with Pinegrow WP - Pinegrow Web Editor - Documentation and Tutorials](http://docsbeta.pinegrow.com/how-to-use-acf-pro-flexible-content-with-pinegrow-wp/)
