7 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:

Themify Parallax WordPress Theme GPL + Lifetime Activation | Auto Updates

$4.99
Themify Parallax WordPress Theme GPL – Themify Parallax WordPress Theme is a combination of two cool trends – parallax scrolling and single-page design. It

Seosight Theme GPL v5.40.0 – SEO, Digital Marketing Agency Website with SHOP

Original price was: $39.00.Current price is: $2.99.
Seosight Theme GPL is a fresh idea for the SEO Agency, Marketing Company, Digital Agency, and e-Commerce. 1 Year Free Update.

GiftXtore Theme GPL v1.7.4 – Luxury Jewelry & Gift Store Elementor WooCommerce WordPress Theme

Original price was: $49.00.Current price is: $3.49.
GiftXtore Theme GPL — GiftXtore is a trendy and creative Elementor WooCommerce WordPress theme. Use on Unlimited Website – Personal or

Cerato Theme GPL v2.2.18 – Multipurpose Elementor WooCommerce Theme

Original price was: $59.00.Current price is: $2.99.
Cerato Theme GPL – is a unique and modern-looking eCommerce Theme built with Elementor page builder. 1 Year Free Update. Unlimited

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 *

Hotel Zante Theme GPL v1.3.5.4 – Hotel Booking WordPress Theme

Original price was: $69.00.Current price is: $3.49.
Hotel Zante Theme GPL – Zante is a WordPress theme crafted for a hotel, hostel, resort, apartment, room reservation, or any other accommodation service. Unlimited Website Usage

Hotel Lux Theme GPL v1.2.8 – Resort and SPA WordPress Websites

Original price was: $69.00.Current price is: $3.49.
Hotel Lux theme GPL becomes a hotel website so easily that you will love it right away – tremendous functionality and

EasyBook Theme GPL v1.4.5 – Hotel Booking, Directory & Listing WordPress Theme

Original price was: $69.00.Current price is: $3.49.
“EasyBook – Directory & Listing WordPress Theme” is perfect if you like a clean and modern design. EasyBook a Hotel Booking

MyTravel Theme GPL v1.0.24 – Tours & Hotel Bookings WooCommerce Theme

Original price was: $59.00.Current price is: $3.49.
MyTravel Theme GPL – MyTravel is a complete Travel WooCommerce Theme for hotels, vacations, rentals, cars, yachts, and activities. Unlimited Website

Sunway Theme GPL v6.8.1 – Hotel Booking WordPress Websites

Original price was: $59.00.Current price is: $3.49.
Sunway Theme GPL is a vacation rental WordPress theme crafted to help you build a profitable vacation rental business. Unlimited Website Usage –

Travelo Theme GPL v5.2.5 – Travel/Tour Booking Responsive WordPress Websites

Original price was: $59.00.Current price is: $3.49.
Travelo GPL is a travel, tour, and booking WordPress theme with an appealing flat design. This fresh WordPress theme comes with

HBook GPL v2.0.27 – Hotel Booking System WordPress Plugin

Original price was: $59.00.Current price is: $3.49.
HBook GPL will allow you to easily enable online reservations on your WordPress website. It is perfectly suited for anybody owning a

Sailing Hotel WordPress Theme GPL v4.3.9

Original price was: $59.00.Current price is: $3.49.
Sailing Hotel GPL is a Creative WordPress theme suitable for travel, tour, hotel booking, room booking, housing, listing, or Airbnb – bed and

Groci Theme GPL v2.2.6 – Organic Food and Grocery Market WordPress Theme

Original price was: $59.00.Current price is: $3.49.
Groci Theme GPL is a ready-to-use, responsive, and innovative organic food WordPress theme that can boost the sales of farming products. The theme allows organic

Lafka Theme GPL v4.5.4 – Multi Store Burger, Pizza & Food Delivery WooCommerce Theme

Original price was: $59.00.Current price is: $3.49.
Lafka GPL is a modern WordPress / WooCommerce theme built with online fast food business needs in mind and great attention to detail,

Hoteller Hotel Booking Theme GPL v6.8.1 – Latest Version

Original price was: $69.00.Current price is: $3.49.
Hoteller WordPress Theme is a responsive WordPress theme created especially for hotels, resorts, and apartments with a completed booking system within

Bellevue Theme GPL v4.2.6 – Hotel + Bed and Breakfast Booking Calendar Website

Original price was: $59.00.Current price is: $3.49.
Bellevue Theme GPL – Perfect for your vacation rental or hotel. Includes a full booking system, availability calendar, and payments through

MotoPress Hotel Booking GPL v5.0.4 – Property Rental WordPress Plugin

Original price was: $59.00.Current price is: $3.49.
WP hotel booking plugin by MotoPress is a complete hotel and vacation rental booking system. As it doesn’t require any

Bloggist Theme GPL v136.8 – Superb Themes

Original price was: $59.00.Current price is: $3.49.
Bloggist Theme GPL is a pure and simple WordPress blog theme for all fans of beautiful design and flexible functionality. Bloggist is created

BlogFeedly Theme GPL v119.5 – Superb Themes

Original price was: $59.00.Current price is: $3.49.
BlogFeedly Theme GPL – It does not matter if you want to create a classic news website, an online editorial

Blogrid Theme GPL v128.4 – Superb Themes

Original price was: $59.00.Current price is: $3.49.
Blogrid Theme GPL is a clean and creative blog theme for writers and bloggers. The theme is responsive, it is fully

RELATED PRODUCTS