Skip Navigation

[Resolved] How to define a Views filter by post date?

This support ticket is created 5 years, 7 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by Pat 5 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1256445

Pat

Hello,

I have created a Views and wants to offer the ability for the users to find posts related to a specific date thanks to a parametric search.
For that, I have tried to add a filter to my Views but did not find the postdate parameter there.
Is there a solution for that?

Regards
Pat

#1256543

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - its not possible to add the front-end filter for post date but you can allowed to add the "Query Filter" for post date but not the front-end filter.

If you want to set up front-end filter for post date field then I the only possibility is you should create a custom field that will hold the post date field value (that means you need to find a way to copy the post date field value to this custom date field) and then add this custom field as a frontend filter.

#1256669

Pat

Hi Minesh,

Tanks for your answer.

I have seen that I can define a date filter (in the upper section of the Views) and I have tested it. That's working and I have used the url parameter to define the right date. Now, I have 2 issues :
1. In this section, you can define the date only by splitting it (year, month, date ...). I would prefer to be able to define the define in one shot !
2. If I understand well, I need to define a form in which I place some parameters and then construct the url with all needed parameters value to redirect to the page where the Views is?

What's your recommandation on this : do I need to use a hook (cred_success_redirect) for that or do you have any other simpler solution?

Regards
Pat

#1256687

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

1. In this section, you can define the date only by splitting it (year, month, date ...). I would prefer to be able to define the define in one shot !
==> Where you want to define this? as there is no such feature available.

2. If I understand well, I need to define a form in which I place some parameters and then construct the url with all needed parameters value to redirect to the page where the Views is?
=> Sorry, this is different question and I do not understand how it's related to the date filter question?

#1256723

Pat

Hi Minesh,

The initial request was to be able to add a parametric search based on the post date to a Views.
Your answer was that was not available in the standard Toolset Views.
So, I'm searching the best way to offer the ability for my users to chose a date (or an in between date) to adjust the result of the Views in the front end.

Something like :
Your date : (a datepicker to select the post date)
Submit

And then, the list of posts with the specific post date.

Regards
Pat

#1256727

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - Yes, correct but:

Something like :
Your date : (a datepicker to select the post date)
Submit
==> How this form you will configure - using Toolset forms? if yes, create form or edit form? In addition to that datepicker will pass the value as timestamp so you need to find a way to convert timestamp to date and set as URL param. You may use the hook cred_success_redirect hook to add/configure your desired URL param and redirect the page on which you have added your view with date filter.

#1256789

Pat

Hi Minesh,

I have created an HTML form using GET and that's OK for my need.
Regards
Pat