4

I have a custom taxonomy registered for my custom post type. I need to make it possible for a user to specify the order in which the taxonomy terms should appear (something like menu order for pages). Then when displaying the taxonomy terms on the site I will use the specified custom order to order them.

What is the best way to do it? Is there any plugin for it?

Many thanks, Dasha

2
  • I have found these lines 'sort' => true, 'args' => array('orderby' => 'term_order') when registering a custom taxonomy at the codex. However, it's not really explained how it works and how it affects a custom taxonomy. Does anyone know? Thank you :)
    – dashaluna
    May 9, 2011 at 15:38
  • I've added an answer here, I've made a plugin that does exactly this -- and it does it pretty well. Sep 22, 2011 at 15:10

6 Answers 6

3

Still looking myself.

After some exploring I decided to use the Term Menu Order plugin by @jameslafferty. This will add menu_order to the terms table and can be used across taxonomies and templates. @TheDeadMedic seems to have enhanced this functionality over here, discussing a similar issue.

3

I just released a plugin to handle this issue. It's up-to-date and I like to think it does things the right way. You can find it here: http://wordpress.org/extend/plugins/custom-taxonomy-sort/.

After installing, you just need to enter the order for the taxonomy terms and your terms will be magically sorted. Please give any feedback that you might have!

0
1

I have a solution to this: http://wordpress.org/extend/plugins/order-up-custom-taxonomy-order/

Order 'em up, set it to auto-sort, knock 'em down!

2
  • Hey, thanks a lot for the plugin - just been testing it and realized that I've got my own SQL query that pulls the terms, I guess I would need to add there a SORT BY clause now? What field does it store the position in? Thanks.
    – dashaluna
    Sep 30, 2011 at 9:20
  • Drew, I've also posted a comment with some questions on your plugin's page drewgourley.com/order-up-custom-ordering-for-wordpress
    – dashaluna
    Sep 30, 2011 at 9:39
0

I'm looking for a solution for the same issue.

@dashaluna the bit of code you found only works for taxonomies that are registered like "tags", tho in a non hierarchical order and sorts the taxonomy terms by entry order. ( that's what i discovered, not 100% sure ).

I personally use a custom field for the terms ( provided via WooThemes Content Builder - can be done with other free plugins ) and to also use that in the front-end to sort terms ordering i will be using a plain MySQL query joining the appropriate taxonomy tables with the additional one for terms meta ( custom fields ) - It 'll probably work for every situation but a raw query would be slower than built-in WP Queries.

0

I came across the My Category Order plugin. However this is for the WP native categories and it adds 'My Category Order' link to the Posts menu where you can drag and drop categories in a required order.

It can be changed (text search and replace) for a custom taxonomy.

Nevertheless, would be nice to have a dedicated plugin for custom taxonomy terms reorder or know how to code it. I would be grateful for any tips.

Thanks!

0

Thank you everyone for advice and apologies, I haven't realised that I hadn't have selected the answer for this question.

Since I've asked it, I came across Category Order and Taxonomy Terms Order plugin. I mainly use this plugin for ordering.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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