I am new to programming and WordPress.
I am working on a project where I am using a custom taxonomy (tag). When I select my tag in the admin panel (post), it automatically gets arranged in alphabetical order.
I’d like to stop that behavior, as I want to display the tags in the order I selected them.
Here you go: just place this in your functions.php:
(Credit goes to lgedeon on the WordPress Core Trac)
Now all you need to do is enter the tags in the order you want them to appear.
Note: the above code shows how to do this for post_tag. If you want a different taxonomy, just update the above code with the taxonomy name you want.
When displaying categories you should use
Instead of
ID
you can usename
,slug
,count
orterm_group
. See Codex