Skip Navigation

[Closed] I want custom filter from date

This support ticket is created 4 years, 12 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Shane 4 years, 12 months ago.

Assisted by: Shane.

Author
Posts
#1841123

Hi Support Team,

I have one website in that one post type called course in course post type there is one field called course start date and i want to add one filter in course archieve the filter is of type dropdown and value of dropdown is "Upcoming course" and "Past course" when i select Upcoming course option show only future course date courses and when you select past course it show the course which date is in past. please review my question and reply me how can i implement.

Thanks

#1841499

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jayesh,

Thanks for getting in touch.

There is a way to do this but it will require some amount of work, as well as it won't work with the AJAX refresh. You will need to Disable AJAX refresh and allow the submit to refresh the page.

The idea is that you will create your filter as a select tag using HTML and then add the submit button. When you submit the search you can use the views query filter to Hook into the submit and check which option the user selected.
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

From there you can modify the date query per the user's option. It will take some amount of PHP code to achieve but it is possible to do.

The only other alternative is by using a datepicker filter that will allow the user to select a range of dates and they can see the courses that fall within those selected dates.

Please let me know if this helps.
Thanks,
Shane

The topic ‘[Closed] I want custom filter from date’ is closed to new replies.