Home › Forums › ACF PRO › Show lowest value › Reply To: Show lowest value
thank you for your answer :),
But it doesn’t return what I wish. I just edit my code to explain precisly; may be it will be cleaner:
<?php if (have_rows('formule')) {
while (have_rows('formule')) {
the_row();
the_sub_field('prix_de_la_formule');
echo '<br />';
$value = get_sub_field('prix_de_la_formule');
$count = count($value); // count number of values in the page
if ($count = 1) {
echo $value; // get the value
}
elseif ($count > 1) {
echo 'from .$lowestValue. to .$hightestValue' ; // get "the lowest value"
}
} // end while have rows
} // end if have_rows ?>
It’s not working of course.
With this one “$value” return a loop repeating the only one value, it’s not what I want.
For lowest and hightest value, it’s not the same prices all the time (depends formula), so I wish make something picking up the values (in table mabe be ?) and compare all of them to display lowest and hightest from the results
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.