Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Echo Custom Field Data, Change Case. WordPress


<strong>Task:</strong> I am building dynamic pages, I have a custom field with the entry=“California”

In some places, I need to echo this in lowercase or first character capitalized.


<em>Echo</em>: California
<em>Echo:</em> california

I studied this page:, I just couldn’t figure out how to integrate with my CF code.


<?php echo get_post_meta($post->ID, location', true);?>

<em>Any suggestions you can provide will be much appreciated!</em>

Answers (1)


Utkarsh Kukreti answers:

<?php echo strtolower(get_post_meta($post->ID, 'location', true));?>
<?php echo ucfirst(get_post_meta($post->ID, 'location', true));?>

West Coast Design Co. comments: