Tell us what you are trying to do? I need to add a 'Launch Date' custom field but it won't have the date.. it will only have the month and year.. and while displaying the date on the post on the front end I would like it to to display in alphabets and not numbers for the month.. so it should be 'April, 2020'.. but it should be filterable and sortable... could you please advise me the best way to do this?
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site? enlace oculto
Hi,
Thanks for asking! I'd be happy to help.
To effectively perform filtering and sorting operations based on date/time, Toolset Types plugin stores the date type custom field values in Unix timestamp (seconds since Unix Epoch) format.
( ref: enlace oculto )
But the good news is that on the front-end, that value can be shown in any date/time format, including only the month and year format, e.g. April, 2020:
https://toolset.com/documentation/customizing-sites-using-php/functions/#date
You can add a new date type custom field "Launch Date" and keep storing the date values as need. Along with the month and year, you'll also have to select the day of the month, but for that, you can select any day for example 1st of every month.
When you'd like to show this value on the front-end, you can use this shortcode to show the date in "Month, Year" format:
[types field='launch-date' style='text' format='F, Y'][/types]
You can read more about date and time formats from this guide:
https://wordpress.org/support/article/formatting-date-and-time/
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
My issue is resolved now. Thank you!
Thanks Waqar.. that was useful info.. it saved me from a lot of unnecessary workarounds I was trying to work on..;-)..
Regards,
Alim