Hi
I need to know the amount of people so that the text says either 1 person or 2 or more people buried and it should come before I get to the loop.
At the moment I have just added another field to add the total and then used an If Elseif statement but I can't see how I can count the number instead based on the loop.
$people_buried = get_field('how_many_buried_in_this_grave');
if($people_buried) {
if($people_buried == 1) {
echo '<p>Listed below, is 1 person buried in this grave.</p>';
} else if($people_buried == $people_buried) {
echo '<p>Listed below, are ' . $people_buried . ' people buried in this grave.</p>';
} else {
echo 'Nobody buried here';
}
}
I suppose I will have to leave it like that as at the most is going to be 4 or 5.
Cheers
Colin