Free Directory, Listing & Classifieds WordPress Plugin Support General HivePress Display category and attributes in the search form

Display category and attributes in the search form

  • Author
  • Ahmet

    How can ı change search extension ?
    I want to add location manuel and using attributes ?


    I can send you an example image are there anybody know ?


    If you enable Geolocation extension and set Google Maps API key then the “Location” field will appear automatically Adding categories to the main search form requires a code snippet, please consider using category selection that is already available in the filter form (on the left side when you search listings).


    okey, ı deleted geolocation. I just want to adding 2 select section categories and attributes to my search form. How ? Thank you.


    I’ll add an option to display attributes in the search form to the next version. Meanwhile, you can use this code snippet:

    And snippet suggested in this topic for displaying a custom attribute


    This snippet didn’t work for me?


    If you mean the first one, it should display the category drop-down like this If the second one, it’s important to replace the attribute name in the snippet (“city”).


    Hello ihor, thanks for the snippet.
    Can you tell me how to display the categories dorpdown in a correct way.
    On my site i have the dropdown list ordered by name also mains categories and sub-categories are mixed.

    It it possible to replace the first option by Categories ?
    Look here to see what i need
    Thanks you.


    Yes, you can add the “placeholder” argument to the list of field arguments in this snippet:

    'placeholder' => 'Categories',

    It will replace the dash. Unfortunately, there’s no simple way to display the category hierarchy in the drop-down yet, this requires further customizations.


    Thanks for the snippet ihor.
    Can you point me how or where i can look to get the category hierarchy please, at the moment the dropdown is not usable.
    Many thanks for all your work.


    This requires setting options as an array like this one:

    'options' => [
    	1 => [
    		'label' => 'Category 1',
    	2 => [
    		'label'  => 'Category 2',
    		'parent' => 1,
    	// ...

    This requires more customizations, e.g. fetching categories first and organizing them into an array where items reference their parent item.


    Yes in know how to do a query in PHP/MSQL to get an array but i don’t know the Wordpres structure. Also in the admin you did it.
    Can you tell me the file i can work on to order them? I’m shure other peoples how use the categories in the search need this feature.
    Thanks in advance.


    ihor i managed to do it thanks


    Hello @Karim how did you do it? and can you send a screenshot of how it looks?

Viewing 15 posts - 1 through 15 (of 23 total)

You must be logged in to reply to this topic.


Sign In

Don't have an account? Register

Forgot password?


Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.