You will need to sort them yourself:
$terms = get_the_terms( $post->ID, 'category');
foreach ( $terms as $term ) {
$newterms[$term->slug] = $term;
}
ksort($newterms);
foreach ( $newterms as $term ) {
echo "<li>" .$term->name. "</li>";
}
Or, if you feel adventurous, the same with a filter:
function alpha_sort_terms($terms) {
remove_filter('get_the_terms','alpha_sort_terms');
foreach ( $terms as $term ) {
$newterms[$term->slug] = $term;
}
ksort($newterms);
return $newterms;
}
add_filter('get_the_terms','alpha_sort_terms');
$terms = get_the_terms( $post->ID, 'category');
foreach ( $terms as $term ) {
echo "<li>" .$term->name. "</li>";
}
Related Posts:
- How to display taxonomy terms the way they are hierarchical
- view subcategories order by id
- Sort on meta value but include posts that don’t have one
- Using Orderby and meta_value_num to order numbers first then strings
- multiple orderby in pre_get_posts action
- Order get_terms using a Custom Field
- Order get_terms() By Custom Field
- get_the_terms in descending alphabetical order
- next and previous post link ordered alphabetically
- Order posts by meta_value even if meta_key is not filled
- Order by first name
- How to alter query order direction using $query->set(‘order’, ‘ASC’); inside a pre_get_posts filter?
- the_tags() : display the tags by the order they are typed in in the backend, not alphabetically
- Display Custom Taxonomy Terns ordered by meta_value
- List taxonomy terms plus their latest post ordered by post date
- Custom Taxonomy terms with latest post ordered by date pagination issue
- Ordering Posts with Custom Taxonomy Terms Array
- How to order posts by meta value?
- How Do I Order Posts by Modified Date? [duplicate]
- Orderby Post Views
- How to order posts (woocommerce products) alphabetically but ignore certain words, eg ‘The’ and ‘An’
- get_terms orderby name as numbers
- Change default ordering of taxonomy terms – pre_get_terms
- Ordering terms before displaying posts
- How to order posts by alphabet with numbers at the end
- Best Plugin to Reorder Post Types
- Ordering system through WordPress
- get_terms orderby numeric
- Order wordpress taxonomy parent terms by their children count
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Issue with multiple orderby values
- get_query_var returns wrong default value
- Use pre_get_posts to sort meta_key by an array of values
- Show first the posts from 1 specific tag
- Allow user to set custom order to a list of custom taxonomies?
- Order posts by price
- All, published and pending order
- get_adjacent_post() returning weird results
- Sort order by slug for looped child terms of custom taxonomy
- Get_Users Orderby Page
- Sort order of next/prev sibling page
- How to order posts by title after they have already been sorted by category
- Order char by post title
- Ordering Taxonomies / Changing term_id
- Why does pre_get_posts() return “date” as the orderby parameter for every sortable column?
- next_post_link and previous_post_link order not working properly
- query pages by a childs publish date
- List most recently added posts (with a twist)
- Check post_date in pre_get_posts
- pre_get_posts shows posts in random order sometimes
- Weekdays as terms – How to order taxonomy terms by ID in admin panel?
- Featured-Content/Featured Posts With Random Order
- Orderby in Query Posts affected by operating system?
- How to Order a list of taxonomies? orderby?
- Ordering posts by title containing numbers
- Stylesheet Enqueue Order and Best Practices
- Order get_terms by multiple meta_values
- wp_list_pages sort order by top nav menu order and child of
- wp_list_categories() by alphabet? (ex. only category titles that start with “A”) [closed]
- Order terms by count – missing terms
- How to add a date creation field when a custom taxonomy relationship is created?
- Order by ASC, DESC, Title, Date from URL on custom page template post
- Offset posts with random order
- Order taxonomy terms wordpress
- Sort query output on taxonomy term archive by post type using pre_get_posts
- ASC and DESC separately from orderby
- Order WP_Query by The Order of an Array in Tax_Query
- struggling to order by title
- Order by two meta values – one is a number and the other is text
- Order posts by taxonomy terms
- Last post sorting get_categories
- How can I order a post query’s results based on the number of matching taxonomy terms?
- Sort by DESC works, ASC doesn’t?
- Shop sends Mail with order cancellation
- List of terms in alphabetical order under the respective initial letter and within columns
- Ordering terms whilst in loop
- update_post_meta saves data but does not show in Order backend
- Changing cache update rate
- How to order taxonomy terms by most recent post?
- Order custom taxonomy hierarchy
- how to complete order status automatically after paypal payment received
- Order management including recurring orders on woocommerce
- Orderby Title not working
- Sort loop by title doesn’t sort single digits like human would
- Sort posts by meta value with get method
- Order terms by creation date
- Orderby taxonomy term id using get_posts not working
- How to order custom user list columns by datetime?
- Creating a post that contains a list of other posts like a table of contents
- Want to order by Meta Values (tweaking Post Order Widget)
- Sorting terms individually for each post
- Changing posts order on a page
- Tax query array terms display out of order
- Order posts with custom taxonomy array
- Ordering Subcategories
- How to order posts by parents?
- single post navigation order (NOT chronological)
- Problem with meta_value order after update
- Random order of posts on each request
- Order taxonomy terms by the frequency of use in the last 30 days