Dropdown

Overview

The dropdown facet type lets users select a single value.

facet-type-dropdown

Available Options

Name Description
Data source Where the values live (taxonomy, custom field, post attribute)
Default label Set the label for the first dropdown option (default: “Any”)
Parent term If Data Source is a hierarchical taxonomy and you want to display only child terms, enter the parent term’s ID.
Value modifiers Enter a list of values (one per line) to include or exclude from the facet’s choices
Hierarchical Whether to indent child terms (this option only appears if Data Source is a taxonomy)
Sort by Sort facet choices by Facet Count, Display Value, Raw Value, or Term Order
Count The number of options to display

Hide Counts

To hide counts from all dropdowns, add the following to your theme’s functions.php:

add_filter( 'facetwp_facet_dropdown_show_counts', '__return_false' );

If you need to hide counts from specific facets, then use this instead:

add_filter( 'facetwp_facet_dropdown_show_counts', function( $return, $params ) {
    if ( 'your_facet_name' == $params['facet']['name'] ) {
        $return = false;
    }
    return $return;
}, 10, 2 );