Custom Field Suite Displaying Loop Values
$loop = CFS()->get( 'ingredients_loop' ); foreach ( $loop as $row => $label ) { echo '<div class="ingredient-row">'; echo '<div class="ingredient-quantity cell">'; //var_dump($label['cfs_quantity']); foreach($label['cfs_quantity'] as $key => $value) { //echo $value; $qty = $value; } echo '</div>'; echo '<div class="ingredient-percent cell">'; //var_dump($label['cfs_percent']); foreach($label['cfs_percent'] as $key => $value) { //echo $value; $percent = $value; } echo '</div>'; echo '<div class="ingredient-ingredient cell">'; //var_dump($label['recipe_ingredient']); foreach($label['recipe_ingredient'] as $key => $value) { echo '<div>' . get_term_field( 'name', $value ) . '</div>'; } echo '</div>'; echo '</div>'; }
$loop = CFS()->get( 'ingredients_loop' ); foreach ( $loop as $row ) { echo 'Quantity ' . array_values($row['cfs_quantity'])[0]; echo 'Ingredient ' . array_values($row['cfs_ingredient'])[0]; }