Skip Navigation

[Resolved] Is it possible to sort taxonomy with the a custom term field?

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 4 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1449385

I'm trying to populate a list of custom taxonomies using get_terms(). Wondering if it's possible to sort by a custom term field. I've created a custom term field ('number') and named it 'category-order'.

#1449595

Hi, in Views, you can create sorted lists of terms without using any PHP. On the other hand, if you're using basic WordPress get_term to query terms, you should be able to find more information about ordering by custom field here in the WordPress documentation:
https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
An example I found online: https://wordpress.stackexchange.com/questions/246975/order-get-terms-by-term-meta

Note that custom fields created in Types have a "wpcf-" prefix in the database, so if your Types term field slug in wp-admin is "email" then the term field slug in the database is actually "wpcf-email".

Let me know if you have additional questions about this.