Support

Account

Home Forums General Issues Formatting Field Label Reply To: Formatting Field Label

  • Thanks but I wanted the label wrapping in HTML not the value, also because you didn’t put your code in code tags when copying/pasting the quotes/apostrophes will be the wrong format.

    I found this code which seems to work well:

    <?php $field_name = "distance";
    	$field = get_field_object($field_name);?>
           <?php if ($field['value']): ?> 																	        
          <span class='post-meta-key'><?php echo $field['label']; ?>:</span> <?php echo $field['value']; ?>									
    <?php endif; ?>

    Let me know if this is a good/bad solution.