This support ticket is created 6 years, 1 month 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Hi - I'm just inquiring if there has been any update on a feature that was requested a while ago. The ability to use Parametric search to filter a view of posts by Date created.
I.e - A drop down filter that can filter posts by month created.
Hi Minesh - I'm not sure I understand. Maybe I'm using the wrong terminology. I think what you are explaining here is how to filter a view down to a certain time period. I.e embed a view in a page that only shows posts from a certain time period.
What I am trying to do is use a parametric search to allow my users to filter a view by post date.
So... I have posts going back several years. I will display all these posts in a view. I want the user to be able to filter down the list on the front end and show posts from any date - they might want to see all posts from September 2017 or January 2018 etc etc (see screenshot date.png for what I would want the user to see on the front end)
A bit like what you helped me with in this ticket (but for date not post status)
Minesh is sick and I'm looking over his support threads.
I think Minesh understood you correctly.
We have a request for the feature you mentioned.
To achieve something similar you would need to modify the query that retrieves posts to manually set up a post_date filter using the API hook wpv_filter_query.
The problem with adding this as a custom search filter is that you need to add the form control to your View to show the dropdown that from which users will select a date. You would need to manually add the markup for such a control, and include a submit button to trigger the search. You would be able to retrieve the submitted date from the $_REQUEST object to use to build the date query arguments in your wpv_filter_query hook.
Really sorry - I don't really understand what you are suggesting I do. My development skills are fairly basic! Is there any chance you could provide an example that I can copy and paste??
Sorry, it's not so simple, because you need to create a custom form control as well as add server-side handling using our API and the wpv_filter_query hook.
If it were just a question of a few lines of sample code to demonstrate how to use wpv_filter_query I could do that, but for this you'll need to either wait for the feature to be added to Views, or arrange for a developer to do the custom work for you. (See https://toolset.com/contractors/)
There isn't existed solution for it, as a workaround, you can setup a custom taxonomy , for example "post-month", edit each post setup term value as below:
February 2018
March 2018
Then you will be able to setup the filter in custom search form as your screenshot hidden link
Can I just check, are you saying create a taxonomy called Post Month and then manually go into each post and tag as the month it was created. And then do that each time a new post is created - or have I misunderstood?
If so, I don't think that will work in this use case. I think I would need it to be automatically populated with the date created because I won't be creating the posts, it will be lots of different users. Just as some background....
I'm trying to create a Q and A functionality for our intranet, where employees can ask questions to our leadership team. I want to display all the answered questions in a view and have them filterable by month answered. I.e a user can use the parametric search for example to show them all the questions that were answered in September 2017.
btw - really appreciate all you guys help so far with this one!
For the question: Can I just check, are you saying create a taxonomy called Post Month and then manually go into each post and tag as the month it was created
It needs custom codes, for example, when user save the post, you can use action hook "save_post" to trigger a PHP function, https://codex.wordpress.org/Plugin_API/Action_Reference/save_post