Possible to hide the whole categories dropdown from the search field (while keeping categories)

Hi!

I would like to hide the whole categories dropdown from the search field on the listings page. I still would like to use categories but I don’t want the users to be able to search based on certain categories.

Thank you for an awesome plugin and thank you for adding the feature so I can choose which categories to show on my listings page when I use the Listings widget in Elementor. That’s a first step to be able to use this plugin on one site but for different stuff. Like jobs and CVs on the same page but without letting candidates browse CVs and without employers to browse jobs.

With best regards,

bb

I think I solved this myself:

add_filter(
	'hivepress/v1/forms/listing_search',
	function( $form ) {
		
		if(isset($form['fields']['_category'])){
			$form['fields']['_category'] = null;
		}
		
		return $form;
	},
	1000
);

I have two categories: cats and dogs. These are represented on mysite.com/cats and mysite.com/dogs.

In the cats page I use elementor and I have added the listings widget and configured it to only show category cats. On the dog page only the category dogs.

The problem I have is that when I hit the search box the search goes for BOTH cats and dogs.

Is it possible to preset the search querry for the category so if the user is on the mysite.com/cats page and hits search the search category is prefilled with cats and the same for dogs?

With best regards,

bb

Hi,

Unfortunately, there’s no such feature, it would require a custom implementation.
If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fvrr.co/32e7LvY

Hi and thanks for the answer!

I see that this functionality is available in the expert hive theme where you can search for services and requests with different attributes for each one. Is this possible to do something similar in the Hivepress plugin without using expert hive? (I need to use the Astra theme for my project).

With best regards,

bb

Hi,

Yes, you can use the Requests extension by purchasing it separately; themes just change the design, and all the functionality is in the extensions.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.