If you use the more generic get_terms you can include in the $args field all of the information to get the term or the children and specifically say what you want to order by and how you want it to be ordered.
Ex.
$termchildren = get_terms( "location",
array(
'child_of' => 4,
'orderby' => 'name',
'order' => 'ASC'
)
);
child_of: Get all descendents of this term. Default is 0. Make sure you use an integer value. Like 1, 2, 3, 4 and not ‘1’, ‘2’, ‘3’, ‘4’.
parent: Get direct children of this term (only terms whose explicit parent is this value). If 0 is passed, only top-level terms are returned. Default is an empty string.
Related Posts:
- How can I order a post query’s results based on the number of matching taxonomy terms?
- Why is my WP_Query not working when tax_query terms are an array?
- List taxonomy terms plus their latest post ordered by post date
- How to add terms to my tax_query based off of the current post
- Change default ordering of taxonomy terms – pre_get_terms
- Pass array of taxonomy terms to wp_query
- Formulate a url to show posts with both taxonomy terms
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Order by slug in get_terms with multiple taxonomies
- Function get_queried_object() return NULL in custom taxonomy
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- Get authors by term id or slug
- How to order posts by title after they have already been sorted by category
- Taxonomy order exception for specific term
- Get posts from multiple tax terms
- How to add custom meta to ‘pre_get_terms’?
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- Can’t get term id for category archive
- How to make a post with certain taxonomy term display first before other post with only one query?
- Only show tag with the same id as the post
- Save queried result into database
- taxquery taxonomy get terms
- How to show terms from another taxonomy
- How to define a custom hierarchy for terms?
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- Custom tag template to list posts in ASC order
- WP_Query orderby date not working
- Order by DESC, ASC in custom WP_Query
- WP_Query order by multiple meta keys & fields
- Secondary Sort (fallback) for WP_Query
- Query Posts in a Predefined Order
- How to get order of posts?
- How do I order pages and categories by ID or name in the same query?
- Get list of posts which have at least one term from a custom taxonomy with WP_Query
- Merge 2 args in one WP_Query and order it by date
- Order posts ascending with number in title
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- Filter and list posts of a custom taxonomy
- List all custom post type posts from a given category?
- Filtering posts by custom field value not working
- WordPress WP_Query orderby being overwritten
- WP_Query Order by Specific Post ID First
- Order Posts by meta value AND published date
- pre_get_posts order by not working
- WordPress Related Post by tags in Single.php
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- Orderby ASC changes to DESC in WP_Query
- WP_Query order result by date AND meta_value
- is_tax() function not working as expected
- Advanced Taxonomy Queries WordPress
- Order by title without taking into account ‘the’
- Custom post taxonomies as tax_query terms?
- Weird orderby => post__in issue
- Taxonomy Query Relation field not behaving correctly?
- Advanced ordering of query_posts
- meta_value_num not ordering all items
- Taxonomy and Date in same query?
- How Can I Change The Tax Query For The Main Loop For Taxonomy Archives?
- How to print term name inside wp post loop
- Loop posts based on permalink term
- Using WP_Query for categories instead of get_terms
- Grabbing taxonomy terms and inserting them into an array
- Child pages not affected by orderby
- WP_User_Query orderby meta_val_num
- Sorting posts by Multiple custom fields in defined order
- Don’t repeat posts from children in parent taxonomy query
- WP_Query orderby random do not repeat infinite scroll – one loop
- Show multiple tax_query from 2 or more post_type in a single code
- get_the_terms has strange result since version 6.0
- Strange behaviour of hierarchical taxonomy archive
- Order posts by taxonomy terms
- How to sort wordpress posts already selected by WP_QUERY
- WP Query by 4 different taxonomies
- Custom WP Query order function possible?
- wp_query with meta_query and tax_query
- How to order taxonomy terms by most recent post?
- Meta query orderby meta_value_num sorting by role first
- Order by value of Custom Field using url string
- Order posts by tags count?
- WP Query with meta queries
- Order Element By Custom Field in WordPress
- Sorting with meta_query and multiple, optional meta keys
- How to break up output of posts for different terms on same page?
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- pages shortcode filtering by category
- get term objects and post objects in query
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- orderby in WP_QUERY – Use the order from the Dashboard
- Search format not matching taxonomy query
- Using orderby with 2 meta keys
- How to get several fields from wp_query?
- query_posts with sorting on a custom datestamp
- Order posts with custom taxonomy array
- Posts2Posts, wp_query and orderby issue
- Can One Taxonomies Terms be Ordered by A Seperate Taxonomy?
- Multiple Orderby is not working right
- Get posts that were most recently tagged
- I need to get all categories from a WP_Query
- Orderby meta _value that is saved as an array
- Filter on one post type with taxonimy and get other post type