Hi,
I use listinghive theme and I would like to know if there is a way to stay within a category page when filtering listings.
When the user is on a category page, on filter form submission, the URL changes to the home URL with the encoded filters. Here is an example:
- When visiting: https://listinghive.hivepress.io/listing-category/services/
- I press the “Filter” button in the side bar, then I am redirected to: https://listinghive.hivepress.io/?_sort=&s=&post_type=hp_listing&latitude=&longitude=&_category=11…
I tried changing the action URL of the filter form using this hook:
function add_listing_filter_form_filter( $form ) {
$form['action'] = hivepress()->router->get_current_url();
return $form;
}
add_filter('hivepress/v1/forms/listing_filter', 'add_listing_filter_form_filter', 1000);
The redirection works well and the URL remains on the category page with the encoded filters, but the problem is that the filters are not applied and all listings in the category are displayed.
Thank you for the support.