As I stated in comments, you can either use usort()
to sort the returned array of terms, or you can just use wp_get_post_terms()
which is already sorted by default by name in ascending order
$terms = wp_get_post_terms( get_the_ID(), 'brand' );
var_dump( $terms );
EDIT
Here is an example with usort()
and get_the_terms()
$terms = get_the_terms( get_the_ID(), 'brand' );
usort( $terms, function ( $a, $b )
{
return strcasecmp( $a->name, $b->name );
});
Related Posts:
- Custom order of terms for custom taxonomy in admin and website
- How can I set a default listing order on the admin page for a custom taxonomy? (without plugins)
- Sort posts by number of matched terms
- Landing in 404 Page on Navigating to Custom Taxonomy Archive
- Link to most recently created category of custom taxonomy in primary navigation menu
- how to get title to custom tags page
- Sorting Posts Via Custom Taxonomy Values Using Checkboxes?
- Getting yoast title for custom taxonomy
- Sort custom taxonomy terms order by both count and name
- Is it acceptable to build functionality into a theme built for a client? [closed]
- Current category link filter
- How to show the entries in a custom taxonomy by author?
- Alter post order on taxonomy template
- query_posts and custom taxonomy posts order
- Sorting Custom Posts on Archive page with pagination
- WordPress Custom post query sorting does not work
- Output unique taxonomy terms of posts inside a loop
- Is it safe to register a taxonomy without using any hooks?
- Changing input type from text to multi select dropdown – skill taxonomy
- how to get term id from current post type instead of name
- WordPress sub taxonomy template
- Dropdown taxonomy lists in admin menu
- Sort taxonomy page alphabetically by meta rather than default post date
- Listing Cities A custom taxonmy by selection order
- True or F False Setting of ‘with_front’ Parameter of Rewrite Is returning Exact Same result
- Get taxonomy link with post type slug prefix
- See double taxonomy inputs in WP editor
- setting a custom post type taxonomy term by code
- transfer two existing taxonomy terms into one custom metabox
- WP Tax query & order by tax query not working
- Group & Sort Taxonomy terms by letter – Is there a better way?
- Permalinks incorrectly inserting multiple categories
- Dynamic drop down of child terms and then drop down posts
- How to get list of custom taxonomies based on custom post type
- sort Posts by custom user filed
- How to make an sql query to exclude everything but custom taxonomy terms in table wp_terms?
- Where to put a migration script to switch post information?
- create taxonomy
- How to associate string with individual use of taxonomy term
- Custom taxonomy with custom meta value is not sorting correctly (query returns the same value for orderby regardless of sort column click)
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- WP Multisite: Are custom taxonomies specific to each site only?
- Order get_terms() by hierarchy
- Separation of presentation and code – WordPress
- My taxonomy won’t be registered. Can’t see it in my back-end
- How to change the theme directory uri for localhost?
- If Custom Taxonomy
- Avoid taxonomy-%term%.php if more than one taxonomy
- What does ‘category__in’ mean in queries?
- How Parent Taxonomy automatically added to the post when using `wp_set_object_terms()`?
- How to set custom capabilities for custom taxonomies?
- Set a featured image as a replacement to the header image
- Update table wp_term_taxonomy.count after INSERT INTO via SQL
- Get posts in certain Taxonomy terms for the current page url
- Custom Taxonomy specific to a Custom Post type – rewrite URL
- Is it possible to have a theme that uses only one single page?
- Having Issue on Passing Variable into HTML Class Tag
- Custom theme: How to call archive-post.php for viewing blog posts
- Get posts by Taxonomy without terms
- WordPress Customizer Default Image
- Why is flush_rewrite_rules mandatory after registering custom taxonomies?
- Is this the proper way to get a taxonomy description into a post template?
- How to write “alt” tag in image for wordpress code?
- Will my site get messed up when the wordpress theme updates if I edited the html code in the editor to change footer?
- underscores use of the article element on the page template
- tax_query not working
- WP REST API – get custom taxonomies based on terms & filter
- Plugin does not work in custom theme
- How can I reduce amount of ifs and else ifs in this specific block of code?
- How to Have a Pure HTML Sub Directory In WP Site
- Weekdays as terms – How to order taxonomy terms by ID in admin panel?
- Returning One custom taxonomy term name
- How to correctly enqueue the parent and child theme stylesheets in the creation of a child theme? [duplicate]
- Question on using custom structures for categories
- How to display ACF taxonomy checkbox links on WooCommerce product category archive
- Make child taxonomy categories use a set template
- Create a child theme from multiple themes
- Using page slug in wp_query
- Theme not showing up
- Return the most recently created custom taxonomy
- Output single post custom taxonomy child terms
- Proper way to update the slug of a taxonomy using register_taxonomy? [duplicate]
- Specify a particular page to list all custom types
- html5-reset theme does not show the image [closed]
- Managing WordPress Theme
- Theming Using Bootstrap Glyphicons and WordPress Dashicons
- Custom taxonomy not showing terms in post area
- Adding content to custom taxonomy category pages
- Display formatted list of taxonomy terms with last seperator different
- Forcing a term/taxonomy on all posts of CPT
- How to customize taxonomy archive template files for subterms?
- Displaying Custom Taxonomy without a hyperlink
- featured content: which area does this cover [closed]
- Are term IDs unique even between multiple custom taxonomies
- How to customize custom taxonomy url?
- Use the same taxonomy twice on the same post type?
- Get object for a few selected taxonomies
- What is the action hook that deletes a taxonomy term from the backend? And how to retireve the term id before deleting it?
- Change image size depending on page
- When filtering query on custom taxonomy; main menu dissapears