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?
- Need help with Query Loop. Need to get current taxonomy term and its posts and group them by a different selected taxonomy term
- Custom tag template to list posts in ASC order
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- WP_Query orderby date not working
- Order by optional meta key?
- Sorting: custom query with orderby meta_value_num THEN by title
- Order by DESC, ASC in custom WP_Query
- WP_Query order by multiple meta keys & fields
- Show posts without term
- WP query taxonomy input differs to output?
- Search custom taxonomy term by name
- Secondary Sort (fallback) for WP_Query
- Query Posts in a Predefined Order
- How to get order of posts?
- Order posts by ID in the given order
- Custom WP_Query order by post_meta and (author) user_meta
- Sorting posts by custom date fields (non standard date format)
- How to display post from current Taxonomy in archive page?
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Display posts the match taxonomy term linked from wp_list_categoies?
- How to order posts tag by tag?
- 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
- WP_Query ordered by custom field that is a date string?
- WP_Query sort by comment meta data
- Order posts by tags count?
- Merge 2 args in one WP_Query and order it by date
- Orderby = none not working [duplicate]
- Move posts to top of WP_Query if in certain Taxonomy?
- WP_query ‘orderby=none’ Problem
- Order posts by date and then by custom field
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- How to order a post type with meta_value_num and if meta_value_num does not exist then order by date
- Revolution Slider Orderby Two Custom Fields
- Display certain amount of posts on taxonomy archive page
- Querying Multiple Custom Taxonomy Terms
- Order posts ascending with number in title
- Order by the results of a function with WP_query
- Get random terms
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- How to order posts in wp_query by a meta_value of the corresponding author
- Order terms inside a select dropdown
- Filter and list posts of a custom taxonomy
- List all custom post type posts from a given category?
- Order by menu structure
- WP Query – Get WooCommerce Products with variation that is in stock
- WP_Query order by date in meta_value
- Filter WordPress posts by between parameter
- How to Modify Taxonomy Archive Page with Search Parameter?
- How to use order RAND() on WordPress?
- Get array of current post term ID’s
- Show all parents and children in custom post type in right order
- Ordering by meta_value AND date NOT WORKING with wp_query
- WP_Query orderby breaks when using AJAX?
- Order WP Query posts by custom order calculated from post meta values
- Filtering posts by custom field value not working
- Custom Post order for homepage
- Meta query with order by another custom field
- Display link to taxonomy archive only if it has posts with certain custom field values
- WordPress WP_Query orderby being overwritten
- WP_Query Order by Specific Post ID First
- Order Posts by meta value AND published date
- How can I pick a single post from the latest 3?
- Wp query orderby ‘title’ doesn’t work
- Order taxonomy terms in alphabetical order
- Is it possible to dynamically get queried term AND taxonomy?
- WP Query for variable taxonomies
- Empty tax_query array returns an empty array
- How do I search inside specific taxonomies in WordPress
- Get taxonomy terms only of the WP_Query current posts
- How can I order Wp_Query hierarchically?
- How do I sort posts with multiple pages
- Sorting posts DESC based on the number of comments using WP_Query
- Get list of terms that have posts in another term