FacetWP Hierarchy Select Addon v0.5.4
This add-on adds a Hierarchy Select facet type that lets you create guided dropdowns based on a hierarchical taxonomy.
Same brand
More from FacetWP
Facetwp
by FacetWP
Use FacetWP to add faceted search to your eCommerce sites, resource libraries, s...
Facetwp Multilingual Addon
by FacetWP
If you are using WPML, Polylang or Polylang Pro, download and install the Multil...
Facetwp Submit Button
by FacetWP
Add a submit button that redirects to a separate results page We often get asked...
Related items
Related Filter Plugins
Filter Everything Pro
by FilterEverything.Pro
Filter Everything — WordPress & WooCommerce product filter plugin, that allows t...
Search & Filter Pro – The Ultimate Wordpress Filter Plugin (addons included)
by DesignsAndCode
The Ultimate WordPress Filter Plugin
WooCommerce Product Filter Pro
by WooBeWoo
Create and customize filters for your online store using Free WooCommerce Produc...
This add-on adds a Hierarchy Select facet type that lets you create guided dropdowns based on a hierarchical taxonomy. Adding the facet Create a new facet, and set the Facet type to Hierarchy select. Click the “Add label” button once for each depth level. If you want to show two dropdowns, then you need two labels. Add the facet to your listing page(s).
Available options Name Description Data source The taxonomy to pull values from. The Hierarchy Select facet expects a hierarchical taxonomy as data source. Sort by Sort facet choices by: Highest count – sorts by the total number of results with that value. Display value – sorts alphabetically according to the label you see on the facet choices. Raw value – sorts by the value that tracks the facet choices.
For example in a dropdown, this is the option value rather than the option label. You can see the raw values in the url after making facet selections. Term order – sorts by taxonomy term order. This option uses term_order which is only available when using a plugin that sets an explicit order for taxonomy terms. FacetWP supports: WooCommerce product categories/attributes order (the drag/drop order) The Hierarchy Select facet also supports the following taxonomy ordering plugins.
Read their linked pages for their specific setup instructions and incompatibilities. We recommend the first two, because they work in most situations. Intuitive Custom Post Order (free) Advanced Taxonomy Terms Order (paid) Category Order and Taxonomy Terms Order (free) Custom Taxonomy Order (free) For term_order to work with these plugins, make sure to use an actual taxonomy as the facet’s data source, not an ACF field set to a taxonomy.
Note that choosing “Term order” will also preserve the order of ACF custom fields that have a user-defined list of choices in a specific order, like Select, Checkbox, and Radio Button field types. If this order is not retained after filtering, and you are using Elementor, see this issue and fix. To customize the sort order, for example switch the ASC/DESC order, or to sort by arbitrary values, you can use the facetwp_facet_orderby hook.
Show depth levels Set custom dropdown labels, and determine which dropdown level appears. Default label: “Any”. Click the “Add Label” button to add (labels for) more levels. Notes: Setting a depth label for a level determines if the dropdown for that level appears. By default, the facet shows only one level. If your taxonomy for example has three levels, and you want them all to appear, you need to set three depth labels.
The depth labels are translatable with the facetwp_i18n hook. Show ghosts Show choices that would return zero results? See the explanation below. Preserve ghost order This option only appears if the Show ghosts setting is enabled. By default, ghost choices will appear at the bottom. With this setting enabled, ghost choices are kept in the same order (mixed with valid choices).
This setting is not available when the “Sort by” setting is set to “Highest count”, in which case the ghost order is ignored. Important: Remember to re-index each time after a term’s hierarchy changes, for example when changing a term’s parent term. What are ghosts? Ghosts are facet choices that do appear in the unfiltered results, but disappear after being filtered out.
If a facet choice has no associated posts, then it will never appear. When “Show ghosts” is enabled, after filtering, facet choices that would return zero results are still shown, but dimmed and not clickable. By default, the ghosts will appear at the bottom of the list of choices. If you enable “Preserve ghost order“, the ghost choices will be shown in the original order (mixed with the other, valid choices), determined by the “Sort by” setting.
Indexing of term hierarchies Posts with only the Paris term selected in the back-end will be displayed in the front-end results if you select “Europe” or “France” in the facet. FacetWP automatically indexes both explicit and implicit term hierarchies. If your taxonomy includes Europe > France and a post has only the France term selected, then Europe will get indexed too for that post.
On the front-end this means that if you have a post that has only the Paris term selected, but not its parent terms (France or Europe), the post will still be displayed in the results if you filter by “Europe”, or “France” in the facet. Hide counts To hide counts from all facets of a type that use a dropdown UI (all Hierarchy Select facets, Dropdown facets, fSelect facets, Range List facets, and Time Since facets (the last two with UI type set to “Dropdown” or “fSelect”), add the following to your theme’s functions.php: How to use custom PHP code? PHP code can be added to your (child) theme's functions.php file.
Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More infoadd_filter( 'facetwp_facet_dropdown_show_counts', '__return_false' ); If you want to hide counts from specific facets with a dropdown UI, then you can select by facet name: How to use custom PHP code? PHP code can be added to your (child) theme's functions.php file.
Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More infoadd_filter( 'facetwp_facet_dropdown_show_counts', function( $return, $params ) { if ( 'my_facet_name' == $params['facet']['name'] ) { // Replace 'my_facet_name' with the name of your facet $return = false; } return $return; }, 10, 2 ); Or by facet type: How to use custom PHP code? PHP code can be added to your (child) theme's functions.php file.
Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More infoadd_filter( 'facetwp_facet_dropdown_show_counts', function( $return, $params ) { if ( 'hierarchy_select' == $params['facet']['type'] ) { // Works for: 'dropdown', 'fselect', 'hierarchy_select', 'range_list', 'time_since' $return = false; } return $return; }, 10, 2 ); Hide disabled child dropdowns Child dropdowns in the facet’s hierarchy will have the class is-disabled as long as their parent dropdown does not have a choice selected yet. If you want to hide these “disabled” dropdowns until they become populated, add the following snippet to your (child) theme’s functions.php: How to use custom PHP code?
PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More infoadd_action( 'wp_head', function() { ?> heading before each
Recent releases
Release history
Frequently asked questions
Is Facetwp Hierarchy Select GPL licensed?
Can I use Facetwp Hierarchy Select on multiple websites?
How much does Facetwp Hierarchy Select cost on GPLCoffee?
Are updates included with Facetwp Hierarchy Select?
Is Facetwp Hierarchy Select safe to download?
Auto-updates included
Install it once, update automatically.
The GPLC Connector installs this plugin from your wp-admin and rolls out new versions to your connected sites - up to 25. Included with 12-month and Geek Lifetime plans (plus legacy 6-month).