Home Support General HivePress How display categories in sidebar in select box?

How display categories in sidebar in select box?

  • Author
    Posts
  • inzerat

    Like this: https://ibb.co/ck2Hv5S

    Please also consider this as a standard feature. I think when there are more categories, it’s totally confusing. And the select box solves it elegantly.

    inzerat

    Radio button are not for more items

    ihor developer

    Thanks, will consider adding an option for this, you can also change this already via a code snippet for “hivepress/v1/forms/listing_filter” hook.

    inzerat

    Am I at least about good?

    add_filter(
    	'hivepress/v1/forms/listing_filter',
    	function( $form ) {
        
    	
    
    		// Add category drop-down.
    		$form['fields']['_category'] = [
    			'type'        => 'select',
    			'options'     => 'terms',
    			'option_args' => [ 'taxonomy' => 'listing_category' ],
    		];
    
    		return $form;
    	}
    );
    ihor developer

    Yes, this snippet should override the built-in radio buttons field.

    inzerat

    ihor@ thanks, please how i can add via this snippet name of filed? above?

    like this: https://pasteboard.co/JLRRdpK.jpg

    ihor developer

    Please try adding the label parameter:

    'label' => 'Category',

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.