Skip Navigation

[Resolved] Frontend filter by post date of views

This thread is resolved. Here is a description of the problem and solution.

Problem:
I am trying to create a view where users can filter using BETWEEN in the dates.
Solution:
- You can make custom date field for parametric search and that field needs to be updated when post will be published/updated.
You may use following function/hook for it:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
https://codex.wordpress.org/Function_Reference/update_post_meta

- You can add static dropdown in parametric search for months/years and then add date filter to get required results. Here is related ticket and doc:
https://toolset.com/forums/topic/date-range-between-fixed-month-links/
https://toolset.com/documentation/user-guides/date-filters/#filtering-between-dates
https://toolset.com/forums/topic/custom-front-end-filter-for-date-range/
Relevant Documentation:

This support ticket is created 6 years, 9 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by randallH-3 6 years, 9 months ago.

Assisted by: Noman.

Author
Posts
#616210

I am trying to create a view where users can filter using BETWEEN in the dates. I can't seem to find the post_date field in the field choices.

#616279

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Randal,

Thank you for contacting Toolset support.

- You can make custom date field for parametric search and that field needs to be updated when post will be published/updated.
You may use following function/hook for it:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
https://codex.wordpress.org/Function_Reference/update_post_meta

- You can add static dropdown in parametric search for months/years and then add date filter to get required results. Here is related ticket and doc:
https://toolset.com/forums/topic/date-range-between-fixed-month-links/
https://toolset.com/documentation/user-guides/date-filters/#filtering-between-dates
https://toolset.com/forums/topic/custom-front-end-filter-for-date-range/

Thank you

#617260

Thanks