Title: Category organisation
Last modified: August 22, 2016

---

# Category organisation

 *  [hs1972](https://wordpress.org/support/users/hs1972/)
 * (@hs1972)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/category-organisation/)
 * I’ve got the search set up nicely on my site. The problem I’m trying to get round
   is that in the category drop down. Some options seem to be in alphabetical order
   then it seems to go to the order of main category with subcategories underneath
   them. What I want is for it to have the main category with the sub-categories
   underneath, indented so it’s obvious they’re sub-categories. Can someone help
   with this please? Many thanks.
 * [https://wordpress.org/plugins/facetious/](https://wordpress.org/plugins/facetious/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [hs1972](https://wordpress.org/support/users/hs1972/)
 * (@hs1972)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/category-organisation/#post-5495679)
 * I found one example by [@tbird12](https://wordpress.org/support/users/tbird12/)
   which would work very well but I get an error on line 185 which would seem to
   be:
 * sort_terms_hierarchy($terms);
 * Can anyone help with this or an alternative solution?
 * thank you!
 *  [ainsworthstudio](https://wordpress.org/support/users/ainsworthstudio/)
 * (@ainsworthstudio)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/category-organisation/#post-5495984)
 * I’ve been trying to figure something similar out. My categories for the faceted
   search are displaying in alphabetical order vs. heirarchal. I can’t figure out
   how to change that according to the plugin.
 * Here is the code:
    <?php do_action( ‘facetious’, array( ‘submit’ => ‘Go’, ‘fields’
   => array( ‘s’, ‘category’, ‘city’, ‘feature’ ) ) ); ?>
 *  [ainsworthstudio](https://wordpress.org/support/users/ainsworthstudio/)
 * (@ainsworthstudio)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/category-organisation/#post-5495985)
 * It seems like the code fix would be in the plugin file template.php line 179:
 * $terms = get_terms( $key, array(
    ‘hide_empty’ => true, ‘hierarchical’ => true));
 *  [ainsworthstudio](https://wordpress.org/support/users/ainsworthstudio/)
 * (@ainsworthstudio)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/category-organisation/#post-5495986)
 * It was!
    According to this: [http://codex.wordpress.org/Template_Tags/wp_list_categories](http://codex.wordpress.org/Template_Tags/wp_list_categories)
 * We can now write this:
    $terms = get_terms( $key, array( ‘hide_empty’ => false,‘
   orderby’ => ‘ID’ ) );
 * And your code will display the category list by ID instead of alphabetical.
 *  Thread Starter [hs1972](https://wordpress.org/support/users/hs1972/)
 * (@hs1972)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/category-organisation/#post-5496009)
 * Thank you for your help, very much appreciated!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Category organisation’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/facetious.svg)
 * [Facetious](https://wordpress.org/plugins/facetious/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/facetious/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/facetious/)
 * [Active Topics](https://wordpress.org/support/plugin/facetious/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facetious/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facetious/reviews/)

## Tags

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

 * 5 replies
 * 2 participants
 * Last reply from: [hs1972](https://wordpress.org/support/users/hs1972/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/category-organisation/#post-5496009)
 * Status: not resolved