Hi everyone, I need some help with customizing my HivePress setup.
I’m using the loan_type taxonomy to filter my listings (hp_listing post type).
- On the default listing archive (
/?post_type=hp_listing), the filters work fine when I pass parameters likeloan_type[]=162. - But on my custom page called “Categories” (
/categories/), where I’m displaying listings using a custom WP_Query, I’m not sure how to make the filters work the same way.
Example working URL on the archive page:
https://getfundsnow.localcontractorsfinder.com/?post_type=hp_listing&loan_type[]=162
Example not working on my custom page:
https://getfundsnow.localcontractorsfinder.com/categories/?loan_type[]=162
On the categories page, I’ve created a template and added a WP_Query with a tax_query, but it’s not applying the filters as expected. Here’s my query code:
php
CopyEdit
$args = [
'post_type' => 'hp_listing',
'posts_per_page' => 12,
'tax_query' => [[
'taxonomy' => 'loan_type',
'field' => 'term_id',
'terms' => $loan_types,
]],
];
I also tried using a shortcode instead of a template, same result.
Question:
What’s the correct way to replicate HivePress’s filtering behavior on a custom page?
Should I manually rebuild the query the same way HivePress does? Or is there a HivePress hook/shortcode I should use instead of WP_Query?
Can I reuse the HivePress filter processing logic on a custom page like /categories/, or should I just redirect users to the archive page?
Any help would be greatly appreciated!