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

Echo Custom Field Data, Change Case. WordPress

  • SOLVED

<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.

<strong>Example:</strong>

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

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

<strong>Code:</strong>

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

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




Answers (1)

2011-07-10

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:

Awesome!