Limited Time Sale - 10% Discount! Use Code:U5ZBQTEY

Hierarchical Filters – Use Parent/Child Levels Option


This document explains how the Use Parent/Child Levels option works in the Divi FilterGrid plugin.

In WordPress, taxonomies can support hierarchical terms or not. Post categories are an example of a taxonomy that has hierarchical support. When creating a new category, you can choose to make the category a child of another category. Post tags are an example of a taxonomy that does NOT have hierarchical support. When creating a new tag, it is not possible to make the tag a child of another tag.

Divi FilterGrid can filter either type of taxonomy – hierarchical or non-hierarchical. To display a hierarchical taxonomy in multiple filter levels, you’ll need to turn on the Use MultiLevel Filters option. Once this is turned on, the Use Parent/Child Levels option will appear immediately below it. Turning this option on will auto create multiple filter levels based on the chosen taxonomy (default is post category).

For example, if a custom taxonomy is not selected in the module’s Parent/Child Taxonomy option, the first level of filters will contain all parent post categories. Once a category is selected, the grid will update to display posts in that category and the next filter level will appear. This next level will contain any child categories of the selected parent category. Once a child category from the second level of terms is selected, the grid will again update to display posts in that child category and the next filter level will appear. This process will repeat until there are no longer any child categories left to display.

There are a few important things to note when turning on the Use Parent/Child Levels option:

  • This option will only work with a single taxonomy
  • This option is not compatible with the Use MultiSelect Filters option
  • Posts must be assigned all levels of a term to be displayed. Assigning a post to a child category but not the parent category will not work.

To control the dropdown label text for each level, you can add the label for each level separated by a pipe | character like this:

 

Divi FilterGrid Hierarchical Filters Dropdown Labels

Pin It on Pinterest

Share This