Views plugin lets you build your own custom search for any content type. These searches can be based on post content, taxonomies and custom fields.
When you ask for help or report issues, make sure to tell us settings for your custom search.
Viewing 15 topics - 2,011 through 2,025 (of 2,068 total)
Problem: I have a custom search View with several search fields placed on a page. Only the search form, not the results, are shown on the page. The View is set up to redirect to a different URL, where the filters and results are both displayed. When Users visit the first page, the URL will have a parameter "promocode" with some variable. When the page redirects to the next step, I want to maintain the original URL parameter on the results page.
Solution: Use the View filter "wpv_filter_end_filter_form" to add a hidden input field to the custom search form, and set the value of the field by accessing the URL parameter in the $_GET superglobal:
Then if your View is set up to "only show available inputs" you'll need to add some custom JavaScript to update the hidden promocode field any time the filters are updated:
jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
var url = new URL(window.location);
var promocode = url.searchParams.get("promocode");
jQuery('#promocode').val(promocode);
});
Problem: I have a custom search View that lists posts. I would like to filter these posts by 3 custom fields. One of the custom fields should be filtered as a range, with a min and max value.
Solution: When adding the Search Filters in your View, choose the option to compare "between", and always compare numbers as type "UNSIGNED".