9 People watching this product now!
Advanced Custom Fields Flexible Content Addon v2.1.0 Original price was: 4.99$.Current price is: 2.99$.
Back to products
Advanced Custom Fields Options Page Addon v2.1.0 Original price was: 4.99$.Current price is: 2.99$.

Advanced Custom Fields Repeater Field Addon v2.1.0

Original price was: 4.99$.Current price is: 2.99$.

SKU: 8 7 5 1 10 Category:

Oment Theme GPL v1.2 – Event & Conference WordPress Theme

Original price was: 29.00$.Current price is: 2.99$.
Oment Theme GPL — Oment Event & Conference WordPress Theme created especially for Event Management, Conferences and Activities. Use on Unlimited

Crypterio Theme GPL v2.4.10 – ICO Landing Page and Cryptocurrency WordPress Website

Original price was: 59.00$.Current price is: 3.99$.
Meet Crypterio GPL – the best-selling premium ICO landing page and Cryptocurrency WordPress theme, that perfectly fits for any type of

Foxiz Theme GPL v2.5.5 – WordPress Newspaper News and Magazine

Original price was: 4.99$.Current price is: 2.99$.
Foxiz Theme GPL – is a WordPress theme perfect for News, magazines, blogs, and all kinds of publishing websites. It

Babun Theme GPL v1.0.0 – Business & Finance WordPress Theme

Original price was: 71.51$.Current price is: 3.49$.
Babun Theme GPL—Business & Finance WordPress Theme is a powerful and versatile solution designed to elevate your financial and corporate

The Advanced Custom Fields Repeater Field Addon allows you to create a set of sub fields which can be repeated again and again whilst editing content!

  • 1 Year Free Update.
  • Unlimited Domain Usage
  • Update Notifications On Email
  • Quick help through Email
  • Original GPL Product From the Developer

Settings

  • Sub Fields
    Defines the set of repeatable sub fields.
  • Collapsed
    Enables each row to be collapsed by specifying a single sub field to display.
  • Minimum Rows
    Sets a limit on how many rows of data are required.
  • Maximum Rows
    Sets a limit on how many rows of data are allowed.
  • Layout
    Defines the layout style of the appearance of the sub fields.
    Table: Sub fields are displayed in a table. Labels will appear in the table header.
    Block: Sub fields are displayed in blocks, one after the other.
    Row: Sub fields are displayed in a two column table. Labels will appear in the first column.
  • Button Label
    The text shown in the ‘Add Row’ button.

Template usage

The Repeater field will return an array of rows, where each row is an array containing sub field values.

For the best developer experience, we created some extra functions specifically for looping over rows and accessing sub field values. These are the have_rowsthe_rowget_sub_field, and the_sub_field functions.

 

Basic loop

This example demonstrates how to loop through a Repeater field and load a sub field value.

<?php

// Check rows exists.
if( have_rows('repeater_field_name') ):

    // Loop through rows.
    while( have_rows('repeater_field_name') ) : the_row();

        // Load sub field value.
        $sub_value = get_sub_field('sub_field');
        // Do something...

    // End loop.
    endwhile;

// No value.
else :
    // Do something...
endif;

Display a slider

This example demonstrates how to loop through a Repeater field and generate the HTML for a basic image slider.

<?php if( have_rows('slides') ): ?>
    <ul class="slides">
    <?php while( have_rows('slides') ): the_row(); 
        $image = get_sub_field('image');
        ?>
        <li>
            <?php echo wp_get_attachment_image( $image, 'full' ); ?>
            <p><?php the_sub_field('caption'); ?></p>
        </li>
    <?php endwhile; ?>
    </ul>
<?php endif; ?>

Foreach Loop

This example demonstrates how you can manually loop over a Repeater field value using a foreach loop.

<?php 
$rows = get_field('repeater_field_name');
if( $rows ) {
    echo '<ul class="slides">';
    foreach( $rows as $row ) {
        $image = $row['image'];
        echo '<li>';
            echo wp_get_attachment_image( $image, 'full' );
            echo wpautop( $row['caption'] );
        echo '</li>';
    }
    echo '</ul>';
}

Nested loops

This example demonstrates how to loop through a nested Repeater field and load a sub-sub field value.

<?php
/**
 * Field Structure:
 *
 * - parent_repeater (Repeater)
 *   - parent_title (Text)
 *   - child_repeater (Repeater)
 *     - child_title (Text)
 */
if( have_rows('parent_repeater') ):
    while( have_rows('parent_repeater') ) : the_row();

        // Get parent value.
        $parent_title = get_sub_field('parent_title');

        // Loop over sub repeater rows.
        if( have_rows('child_repeater') ):
            while( have_rows('child_repeater') ) : the_row();

                // Get sub value.
                $child_title = get_sub_field('child_title');

            endwhile;
        endif;
    endwhile;
endif;

Accesing first row values

This example demonstrates how to load a sub field value from the first row of a Repeater field.

<?php
$rows = get_field('repeater_field_name' );
if( $rows ) {
    $first_row = $rows[0];
    $first_row_title = $first_row['title'];
    // Do something...
}

You may also use the break statement within a have_rows() loop to step out at any time.

<?php 
if( have_rows('repeater_field_name') ) {
    while( have_rows('repeater_field_name') ) {
        the_row();
        $first_row_title = get_sub_field('title');
        // Do something...
        break;
    }
}

Accesing random row values

This example demonstrates how to load a sub field value from a random row of a Repeater field.

<?php
$rows = get_field('repeater_field_name' );
if( $rows ) {
    $index = array_rand( $rows );
    $rand_row = $rows[ $index ];
    $rand_row_title = $rand_row['title'];
    // Do something...
}

Reviews

There are no reviews yet.

Be the first to review “Advanced Custom Fields Repeater Field Addon v2.1.0”

Your email address will not be published. Required fields are marked *

Easy Digital Downloads Amazon S3 Addon GPL v2.4.1

Original price was: 59.00$.Current price is: 3.49$.
Amazon S3 is the largest and most performant file storage service available. Even if you have only a small number or

Easy Digital Downloads Pushover Notifications v1.3.3 Addon GPL

Original price was: 59.00$.Current price is: 3.49$.
Pushover Notifications for Easy Digital Downloads is an extension that allows you to receive push notifications of sales and daily earnings

Easy Digital Downloads Resend Receipt Addon v1.0.2 GPL

Original price was: 59.00$.Current price is: 3.49$.
The Resend Receipt extension for Easy Digital Downloads allows your customers to resend their purchase receipts directly from your website without logging

EDD Featured Downloads Extension GPL v1.0.5

Original price was: 59.00$.Current price is: 3.49$.
EDD Featured Downloads GPL – This extension is aimed at developers/clients who need to show a list of featured downloads. Unlimited

EDD Purchase Limit Addon GPL v1.3.1

Original price was: 59.00$.Current price is: 3.49$.
EDD Purchase Limit Addon GPL – This extension allows you to specify purchase limits on a per-product basis. Want to disable

EDD Authorize.net Payment Gateway Addon GPL v2.0.5

Original price was: 59.00$.Current price is: 3.49$.
This add-on payment gateway allows you to accept credit cards directly on your Easy Digital Downloads powered store through your Authorize.net account.

Easy Digital Downloads Duplicate Downloads v1.0.2 Addon GPL

Original price was: 59.00$.Current price is: 3.49$.
This plugin allows users to easily duplicate a download. When the “Duplicate” button is clicked, the details of a product

Easy Digital Downloads Variable Pricing Switcher v1.0.5 Addon GPL

Original price was: 59.00$.Current price is: 3.49$.
This extension allows customers to easily switch between price options on the checkout screen. Keeping customers on the checkout screen

Easy Digital Downloads User History Addon v1.6.2 GPL

Original price was: 59.00$.Current price is: 3.49$.
If you’re in the dark about how customers are browsing your site, the User History Add-on is the beacon you’ve

Easy Digital Downloads Upload File Addon v2.1.5 GPL

Original price was: 59.00$.Current price is: 3.49$.
This extension allows your customers to upload files before or after completing an order. You can enable the upload file

Easy Digital Downloads Slack Addon v1.1.3 GPL

Original price was: 59.00$.Current price is: 3.49$.
At Easy Digital Downloads, we use Slack all day, every day. Slack is an incredibly powerful and easy-to-use real-time chat application

EDD Conditional Emails AddOn GPL v1.1.2 | Easy Digital Downloads Conditional Emails AddOn GPL

Original price was: 59.00$.Current price is: 3.49$.
EDD Conditional Emails AddOn GPL — Automate your store’s email notifications with Easy Digital Downloads Conditional Emails. Trigger emails based on

Easy Digital Downloads Zapier GPL v1.4.0

Original price was: 59.00$.Current price is: 3.49$.
Easy Digital Downloads Zapier GPL— A simple and powerful way to integrate your Easy Digital Downloads store with 5,000+ third

Easy Digital Downloads Wallet WordPress Plugin GPL v1.2.1

Original price was: 59.00$.Current price is: 3.49$.
Easy Digital Downloads Wallet WordPress Plugin GPL— Wallet for Easy Digital Downloads adds a deposit system to your website that

Paddle Payment Gateway GPL v2.0.4 – Easy Digital Downloads

Original price was: 59.00$.Current price is: 3.49$.
Paddle Payment Gateway GPL– Selling WordPress themes, plugins or designs using Easy Digital Downloads? Connect with Paddle and accept one-time

EDD Checkout Fields Manager Addon GPL v2.2.1- Easy Digital Downloads

Original price was: 59.00$.Current price is: 3.49$.
EDD Checkout Fields Manager Addon GPL – EDD Checkout Fields Manager Addon to easily add new text fields, drop-downs, file upload

RELATED PRODUCTS