Skip Navigation

[Resuelto] Format custom post_meta as date

This support ticket is created hace 4 años, 1 mes. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Etiquetado: 

This topic contains 2 respuestas, has 2 mensajes.

Last updated by thomasS-11 hace 4 años, 1 mes.

Assisted by: Shane.

Autor
Mensajes
#1530725

Hey. I have a date field (Y-m-d) stored as post_meta from another plugin.

I am trying to format it differently in Views.

I tried to just copy the format="d-m-Y" from the wpv-post-date but that didn't work.

Is there any way that i can format this differntly in the View?

#1530927

Shane
Supporter

Languages: Inglés (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Thomas,

Thank you for getting in touch.

"I have a date field (Y-m-d) stored as post_meta from another plugin."

If this field is created by another plugin then the plugin should provide a way to display the date field in the format you want.

The [wpv-post-date] field will only display the default date meta field that is stored on the post i.e the published date.

This shortcode won't display the custom field date that you have.

If the plugin doesn't provide a way to format the date then you will need to do this with custom code.

Thanks,
Shane

#1532225

The shortcode isn't from the plugin. The shortcode is a Views shortcode that's simply fetching post_meta from the current post.
My question and what i was hoping for, was that Views shortcode had a format feature, so it was possible to format the value to a specific date format, even though the field is not a Types field, but simply a post_meta value.
I do know that wpv-post-date is the date from the current post. My hope was that i could use the same attribute "format" to format the data, even if it wasn't a wpv-post-date shortcode.

I will format the value myself in my own shortcode, this way i can move on.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.