Home › Forums › Add-ons › Repeater Field › Print different text based on the number of lines › Reply To: Print different text based on the number of lines
i don’t know if i did it right, this is the code i managed to do and it works
<?php
if( have_rows('misure_e_prezzi')):
$rows = get_field('misure_e_prezzi' );
$my_fields = get_field_object('misure_e_prezzi');
$specific_row = $rows[0];
$first_row_price = $specific_row['prezzo' ];
$count = (count($my_fields['value']));
$valuta = '€ ';
?>
<div class='prezzo'>
<?php
if ($count ==1)
echo $valuta .number_format( $first_row_price, 2, ',', ' ');?></div>
<?php
if ($count >1)
echo 'A partire da: '?>
<div class='prezzo'>
<?php
if ($count >1)
echo $valuta .number_format( $first_row_price, 2, ',', ' ');?></div>
<?php
endif;
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.