Custom post Meta Date Format
-
I am using this code to get a custom field with a date stored withing the contact form 7 plugin, 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” within the sent email but I need it formatted as “Friday, January 31st, 2014”, but I can seem to get this to work.
Here is what I have tried, but does not work:
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 ) ) );
https://www.ads-software.com/plugins/advanced-custom-fields/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom post Meta Date Format’ is closed to new replies.