1 2 3 4 5 6 7 8
<?php $class = the_field('status') == 'new' ? 'status' : 'statusSold'; echo '<span class="' . $class . '">' . the_field('status') . '</span>'; function the_field($str) {echo 'new';} // just a mock function for testing purposes
1
newnew<span class="statusSold"></span>