Skip Navigation

[Resolved] Extract date

This support ticket is created 6 years, 4 months ago. 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.

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 6 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#1080714

Hi,
I am using a plugin to display a carousel of custom posts in Divi.
This plugin allows also to display custom fields.

While it works perfect with Types string fields, I have some problem with Types date fields, as these render the special timestamp containing date and time (eg. "1539986400")

There is a way to show only the date?
Please notice that the plugin doesn't allows to insert shortcodes, but only custom fields slugs (eg." wpcf-valid-from").

Any workaround?

Thanks

Best

#1081115

Hello,

I assume we are talking about a custom date field created with Types plugin.

If it is, please try the shortcode [types] for display the date and time values, for example:
[types field="valid-from" format="Y/m/d g:i:s A"][/types]

see our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/#date

#1081516

Hi,
correct. We are talking about Types custom date fields.

Sadly, this portfolio plugin doesn't accept shortcodes.
I can only use the name of the custom field (in this case "wpcf-valid-from")

Can I use an additional Types string field that automatically will be populate with this shortcode?
Something like "wpcf-valid-from-date" with "[types field="valid-from" format="d/m/Y"][/types]" inserted.

Would that work? Or there is a better solution?

Thanks

Best

#1081789

No, there isn't such a built-in feature within Types plugin.
I suggest you check it with the author of "portfolio plugin", check if there is any way to use the shortcodew with this plugin, the shortcode is a built-in feature of WordPress, most of plugins/themes support wordpress shortcode.

#1083113

I do really miss a simple date field.
Or at least an options in the current date field to choose what should be stored.

#1083298

The Types custom date field stores value in time-stamp format
hidden link

There isn't such an option to choose what should be stored, but you can display it in different format with Types shortcode.

The problem is in the "portfolio plugin" side, it does not support the standard wordpress feature: shortcode.
https://codex.wordpress.org/Shortcode_API

As I mentioned above, you can you check it with the author of "portfolio plugin", maybe they have other solutions or some workaround.

If you need custom codes solution, you can also check it with our experienced contractors:
https://toolset.com/contractors/