Title: about sub categories
Last modified: August 31, 2016

---

# about sub categories

 *  [abdo.nahas](https://wordpress.org/support/users/abdonahas/)
 * (@abdonahas)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/about-sub-categories/)
 * my code is from your support and I try to make some changes but its so difficult
   for me can you help me please?
 *     ```
       function my_product_list() {
   
       	$posts = get_terms( array( 'type' => 'post', 'hide_empty' => '0', 'orderby' => 'term_id', 'order' => 'ASC', 'hierarchical' => '1', 'taxonomy' => 'spark-pro-cats'  ) );
       	foreach ( $posts as $post ) {
   
       			$label = $post->name; // label of menu select option
       			$value = $post->name; // value of menu select option
   
       		$options[$label] = $value;
       	}
       	return $options;
       }
       add_filter('list-of-products', 'my_product_list', 10, 2);
       ```
   
 * now my aim is to make is if has sub category we will add under the main category–
   or if has second sub –. in other words Main category(will be bold) > sub category
   and sub sub category.
 * how we can do this. I try to make it with other ways but I cant.
 * [https://wordpress.org/plugins/contact-form-7-dynamic-select-extension/](https://wordpress.org/plugins/contact-form-7-dynamic-select-extension/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [John Huebner](https://wordpress.org/support/users/hube2/)
 * (@hube2)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/about-sub-categories/#post-7443098)
 * This plugin only handles simple select field choices and won’t do anything complicated
   like creating a hierarchical layout of choices, so I don’t think it will do what
   you’re looking for.

Viewing 1 replies (of 1 total)

The topic ‘about sub categories’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-dynamic-select-extension.
   svg)
 * [Dynamic Select for Contact Form 7](https://wordpress.org/plugins/contact-form-7-dynamic-select-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-dynamic-select-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-dynamic-select-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-dynamic-select-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-dynamic-select-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-dynamic-select-extension/reviews/)

## Tags

 * [custom taxonomy](https://wordpress.org/support/topic-tag/custom-taxonomy/)

 * 1 reply
 * 2 participants
 * Last reply from: [John Huebner](https://wordpress.org/support/users/hube2/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/about-sub-categories/#post-7443098)
 * Status: not resolved