Skip Navigation

[Resolved] how to order the taxonomy terms other than name or date.

This support ticket is created 2 years, 10 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 2 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#2415755

Hi Luo
I was able to create one of the views and now I can just duplicate the process. The next thing is how to order the taxonomy terms other than name or date.

In one example I have a members taxonomy of positions like President, Vice President, Treasurer, etc... How can I organize the taxonomy terms in a custom order and then display them?

#2415761

Hello,

I assume we are talking about the left part of below page, under text "Unifor87-M":
hidden link

If it is, it is possible with a taxonomy view, for example:
1) Enable legacy editor:
https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/
2) Dashboard-> Toolset-> Views, create a new taxonomy view:
- Query terms of your custom taxonomy
- Order the results by:
a) Term name
b) Term Slug
c) Term group
d) Post count
...
- In view's loop, display term information

#2415821

I was referring to the right side where the Executive are organized by position ( a Taxonomy)
Unit Chair, Vice Chair,Secretary and Membership Secretary. The same for the row below that of Steward are all ordered by the Stewards Taxonomy. In Drupal I was able to specify the exact order.
None of the 4 order methods a,b,c.d would work as the order has to be completely custom.
Is there are way to place all the slugs or ids in the order I want them displayed?

I tried using a plugin to organize the taxonomy where you can drag the terms to the order you want want but views does not recognize the order.

#2415893

Unfortunately, Toolset taxonomy view does not support third party plugin custom orderby settings.
You might consider custom codes, for example:
1) Add a custom taxonomy field into your custom taxonomy
2) Use filter hook wpv_filter_taxonomy_query to trigger a PHP function
3) In this PHP function, sort the taxonomy view results by above taxonomy field of step 1)
More help:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_taxonomy_query
https://developer.wordpress.org/reference/classes/wp_term_query/__construct/

#2416223

Thanks Luo
It looks like this will work.

#2416485

Please update here if you need more assistance for it. thanks