Custom post Meta Date Format
-
I am using this code to get a custom field with a date stored, generated by the ‘advanced custom fields’ plugin:
elseif ( '_post_event_date' == $name ) $output = get_post_meta($post->ID, 'event_date', true);
This gets the date and displays it as “20140131” withing the email but I need it formatted as Day Month Year, but I can seem to get this to work.
Here is what I have tried:
elseif ( '_post_event_date' == $name ) $output = get_post_meta($post->ID, 'event_date', true); esc_html_e( date_i18n( 'l, F jS, Y' , strtotime( $event_date ) ) );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom post Meta Date Format’ is closed to new replies.