Answers for "how to get the content and loop through it acf"

PHP
2

acf repeater

<?php 

$rows = get_field('repeater_field_name');
if($rows)
{
	echo '<ul>';

	foreach($rows as $row)
	{
		echo '<li>sub_field_1 = ' . $row['sub_field_1'] . ', sub_field_2 = ' . $row['sub_field_2'] .', etc</li>';
	}

	echo '</ul>';
}
Posted by: Guest on June-02-2020

Code answers related to "how to get the content and loop through it acf"

Browse Popular Code Answers by Language