Skip Navigation

[Resolved] Display view results by year dropdown using a date custom field

This support ticket is created 5 years, 8 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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by vimalS 5 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1236039
Screenshot_3.png

Tell us what you are trying to do? Display view results by year dropdown using a date custom field

Is there any documentation that you are following? https://toolset.com/forums/topic/group-views-results-by-year-using-a-date-custom-field/

Is there a similar example that we can see?

What is the link to your site? hidden link

#1236798

Hi Vimal,

Thank you for waiting, while I performed some tests.

Since the date type custom field's value is saved in Unix timestamp format, it is not currently possible out-of-the-box, to use that in only a year based front-end search filter.

You're welcome to submit this as a feature request at:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

For now, you can use a workaround in which each post's release year is saved separately in a new "Release Year" custom field ( which would be a "Number" type field and not a "Date"). That custom field can then be used directly for a front-end search filter for the year.

Website's admin can either fill the year's value manually in that new field or you can use a custom PHP function to update that automatically.
( ref: https://toolset.com/documentation/customizing-sites-using-php/updating-types-fields-using-php/ )

For more personalized assistance around custom code, you can hire a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#1236806

My issue is resolved now. Thank you!