Black Friday Sale
Upto 40% OFF
Discount Auto Applied
Days
Hours
Seconds
ACF Nested Repeaters is a fascinating feature. However, embedding numerous repeaters within a parent repeater block may be hard to implement on the frontend as you need to write tons of PHP code.
But don’t worry; we have a complete code-free solution in this tutorial with the help of our plugin AnyWhere Elementor Pro. To give you a better understanding of how nested repeaters work, we will be recreating the below demo of this Hosting Price table.
This is inspired by the pricing page structure of Cloudways hosting. The first level of repeater field is to add hosting platforms, like Digital Ocean, Linode, or Vultr. Withing each platform, there are multiple monthly plans which are managed by the second-level repeater field. And then there is a third level of repeater field to manage features of each plan.
So, let’s see the setup.
Please check our detailed article on ACF Repeater Field Complete Guide.
2. Then add a custom field (Platform) and make it a repeater field type.
3. Now, we need to add sub-fields to this Repeater block; for this demo, I have created two sub-fields. Title and Plans. Where Plan is also a Repeater field. The first level of nested Platform -> Plans.
4. Now add subfields inside the Plan Repeater field. I have added three subfields in this: Price, Configuration, and Features. Both the fields Configuration and Features are of Repeater type. So, here comes the second level of nested Plans-> Configuration-Features.
5. Add some subfields to the Configuration repeater.
Then, add some subfields to the Features repeater.
6. Once done, save the changes.
Till now, we have completed our ACF Nested Repeater Field setup; next, you need to populate these fields onto a page or post just like we do for the rest of our Custom Fields.
After setting up the repeaters, our next step is to design the templates for each repeater block that we have created – Features, Configuration, Plans, and Platform.
For creating the templates, I will be using AnyWhere Elementor Pro. We will start with the innermost block – Features and Configuration and then move to Plans and Platform.
Now, let’s start with creating a template for the Features and Configuration block.
1. Create a new AE Template, and then under the AnyWhere Elementor settings, do the following configurations.
Note: You need to follow the same settings for creating the block layout for the Configuration repeater block. Just in the Repeater field, select Configuration in place of features
2. Next, edit the template in the Elementor editor.
3. Under the Elementor editor, use the AE – ACF Fields widget and configure it.
The Plan repeater block acts as a container for the sub repeaters(features, Configurations). So, while designing its template, we will have to display data from sub repeaters also.
In Elementor
1. First, add ACF Fields to display the data from the Price field.
2. Then, to display data from the sub repeater field, we’ll use the AE- ACF Repeater widget.
3. Configure the widget:
4. Similarly, we need to add one for the ACF Repeater widget to display the data from the Features Repeater. Configure the widget the same way we did in the above step.
1. Create a new AE Template.
2. In Elementor, Add the AE – ACF Repeater widget and configure it. In Block layout, select the one we just created for the Plans repeater field. And in the Repeater field name choose Plans.
Here is the final look of the layout, containing all the nested repeaters.
Now, we will be using the above-created templates to display the repeater field content on the page.
And that is it; you are done. Have a look at the final output.
As demonstrated in this tutorial, displaying the nesting repeater data on the Elementor frontend is a breeze. When we say Nested Repeater, people start thinking of the amount of code required for front-end implementation, but we have achieved this without writing a single line of code. So, make as many nested repeaters as you want and have total control over their templates designed according to your needs and creativity.