I have a search for with some search filters (taxonomy checkboxes). I want to have the results show on another result page. This works fine, but when I return to the search page it does not remember the selected search criteria.
If I change the setup to have both search form and results on the same page it works, but I do not want this.
How can a make it work with separate search form and results?
Hope you can help
Hi,
Thank you for contacting us and I'd be happy to assist.
To create a "Back" link on your view's search results page, that keeps the selected search form's filters intact, you can follow these steps:
1. You'll need a custom shortcode, that can get the URL parameters from the current page's URL.
For example:
add_shortcode('show_current_url_query', 'show_current_url_query_func');
function show_current_url_query_func() {
return $_SERVER['QUERY_STRING'];
}
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file.
2. Next, on your search results page, you can include a "Back" link that uses this shortcode, like this:
<a href="[wpv-post-url id='123']?[show_current_url_query]">Back</a>
Note: You'll replace "123" with the actual ID of your page with the search form.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar