Hi there,
I was trying to implement a post status filter via [wpv-control].
I tried to include this code in my view:
[wpv-control field="my-post-status" url_param="my-post-status" type="select" values="any,publish,draft" display_values="Any,Publish,Draft"]
Instead of all options (any, publish, draft), the wpv-control only sets the first option and ignores the further ones.
<select id="wpv_control_select_my-post-status" name="my-post-status[]" style="" class="js-wpv-filter-trigger ui fluid input wpcf-form-select form-select select">
<option value="any" selected="selected" class="js-wpv-filter-trigger wpcf-form-option form-option option">Any</option>
</select>
if i just erase the field="my-post-status" it shows all options but isn't working.
Thanks!
Hello, thank you for contact us. I will try to do my best to help you.
I would need some more info about the issue. What is the URL where you are trying to apply that filter? Can you share a link? Also, could you share privately the access to your site, I would like to take a look at the view that you have created in order to do some tests. I will enable next reply as private, that's means that only you and I are able to see the credentials.
Thanks.
Hello again, it seems that the problem is related to the AJAX request. I have not been able to reproduce the issue in a clean install, so I would recommend you to change the option in Custom Search Settings from "AJAX results update when visitors change any filter values" to "Full page when visitors click on the search button".
Please let me know if this solves the issue or if you need further details.
Have a good day.
Hi José,
I changed it form ajax update to update full page when search button is clicked.
The search is working when url is changed, but in the select field I can't see all options.
In my opinion there must be something wrong with the field="" params of the wpv-control.
I checked what happens if i leave the field="" empty.
All the assigned values appear and search is working but only for the first time i click the search button.
If i want to reset the search it's not emtying the url from post_status.
and if i try to search a second time it's not working.
Hi Josè,
I had to set that all and not only existing values should be put out.
Now it works!
Thanks