I found a great article on Custom Taxonomies here. I have a specific requirement related to ordering values entered in the Custom Taxonomies. How do I display the terms entered in the meta boxes in the order I entered them and “NOT” in alphabetical order.(ex. If I enter Edward, Linda, Arnold in meta boxes, how do I NOT display them Arnold, Edward, Linda).

Thanks in advance. Any help would be greatly appreciated.


To print its categories that article uses the function wp_list_categories. The parameter that dictates how elements are ordered is "order_by" which it sets to "name". Other options are listed under parameters, order by, on that function's page in the codex: http://codex.wordpress.org/Template_Tags/wp_list_categories

It seems that the option you have are ID, name, slug, term_group and count. Anything else will require more work than just changing a parameter. The solution might depend on what kind of sorting you are looking for.

  • Calle, thanks for your response. I tried changing the name to "id" for the orderby and it does exactly what I want. But the problem is that it displays "all" the taxonomies terms. I want to display only the ones specific to my custom post. I am currently using "get_the_term_list" method but it displays taxonomy terms in alphabetical order. – Anish Oct 16 '12 at 14:45
  • get_the_term_list is a helper function that retrieves terms and prints them in a list. The best you can do if you want to change the order is to use wp_get_object_terms (codex.wordpress.org/Function_Reference/wp_get_object_terms) and print the list yourself as in the example on the page I just gave a link to. It takes a list of arguments, of which one is orderby, just like wp_list_categories. – user5028 Oct 16 '12 at 23:55
  • Nice! That method was exactly what I needed and has worked out for me. Thanks. – Anish Oct 22 '12 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.