I am using the More Fields plugin which gives me the ability to create a date formatted YYYY/mm/dd and I want to convert that to be shown like: February 11, 2011
Is this possible?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityDo you have issue with exactly converting or retrieval? Converting is trivial and is plain PHP:
date('F j, Y', strtotime($date));
For more complex and WordPress-specific way with localization support see date_i18n()
function.
meta()
is native function?.. Are you sure you get sane string value in $date
?
This works for me (inside the loop)...
<?php $date = get_post_meta($post->ID, 'CUSTOM-FIELD-HERE', true); if($date != ''){echo date("l jS F Y", strtotime($date));} ?>
<?php
$date = '2000/10/28';
$a = preg_split ( '/\//', $date );
echo date('F j, Y', mktime( 0, 0, 0, $a[1], $a[2], $a[0] ) );