Display ACF field only if value is greater than 0
I see you’ve found your own answer, but I wanted to offer some advice for making your code a little more succinct. <?php // Different versions of a number $unformatted = get_field(‘paid_attendance’); $cleaned = str_replace(‘,’, ”, $unformatted); // Remove commas from string $integerValue = absint( $cleaned ); // Convert to absolute integer. $floatValue = number_format($cleaned, … Read more