Create second category filter
-
Hi,
I would like to create a second category filer (dropdown) so a user can filter by for example ‘Store Type’ and ‘Store Size’. I have 2 parent categories set up ie Type and Size and they each have the relevant child categories. I am successfully populating the normal category filter dropdown with just the child categories of Type using thisadd_filter( 'wpsl_dropdown_category_args', 'nm_custom_dropdown_category_args' ); function nm_custom_dropdown_category_args( $args ) { if ( is_page( 'home' ) ) { $args['parent'] = 6; // parent category ID of Type $args['hierarchical'] = true; // only show the child categories of Type } return $args; }
I guess I could create secondary create_category_filter() and set_selected_category() functions but hoping their might be a better way?
Many thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Create second category filter’ is closed to new replies.