Support » Plugin: Beautiful taxonomy filters » Only Show Parent Category in Drop Down

  • Hi,
    Thanks for this great plugin!

    Is this possible to modify filter form to display only parent category. And when a parent category is selected, visitors get option to select sub-category of this parent category.

    1. Search form displays only parent taxonomies.

    2. When any parent taxonomies is selected, visitors will get options to select sub-category of selected parent taxonomy.

    Currently the filter form shows all parent and child categories.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Any luck ?

    You can show only parent categories by using below code in functions.php of your theme.

    But I am still waiting for reply to show child categories options when parent category is selected in drop down list.

    function modify_dropdown_depth($args, $taxonomy){
    $args['depth'] = 1;
    return $args;
    add_filter('beautiful_filters_dropdown_categories', 'modify_dropdown_depth', 10, 2);
    Plugin Author Jonathandejong


    Hi @ravi9

    I think you’ll need to do that through custom CSS and JS.
    However it likely wont be possible with select2 active because it removes the contextual parent/child classes on the option elements.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Only Show Parent Category in Drop Down’ is closed to new replies.