Skip Navigation

[Resolved] Alphabetic order of taxonomy

This thread is resolved. Here is a description of the problem and solution.

Problem:

I have my taxonomy that I display in alphabetical order with a view.
Is it possible to create a filter / radio button or other to filter the view starting from one letter?

For example:
The view displays the word that begins with A to Z
If I digit or choose - in the radio button - letter M I would that view displays the term from letter M to Z.

Solution:

I assume we are talking about a taxonomy view, which is for querying terms of a custom taxonomy.

If it is, there isn't such a built-in feature within Views plugin, the taxonomy view does not support front-end search form or front-end sorting, you can edit your "taxonomy view", click "Screen Options", enable option "Custom Search Settings".

In section "Custom Search Settings", you should be able to see below message:
Only Views listing posts can have custom search inputs.

But you can try to setup some custom PHP codes to achieve what you want, for example, you can use Views filter hook "wpv_filter_taxonomy_query" to trigger a PHP function, in this function setup the custom filters, more help:

https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_taxonomy_query
When displaying a View listing taxonomy terms, this filter is applied to the arguments that will be passed to the get_terms() call.

https://developer.wordpress.org/reference/classes/wp_term_query/
Class used for querying terms.

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_taxonomy_query

This support ticket is created 6 years, 1 month 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 2 replies, has 2 voices.

Last updated by fulvioT 6 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#626727

Hi,

I have my taxonomy that I display in alphabetical order with a view.
Is it possible to create a filter / radio button or other to filter the view starting from one letter?

For example:
The view displays the word that begins with A to Z
If I digit or choose - in the radio button - letter M I would that view displays the term from letter M to Z.

thanks
fulvio

#626818

Dear fulvio,

I assume we are talking about a taxonomy view, which is for querying terms of a custom taxonomy.

If it is, there isn't such a built-in feature within Views plugin, the taxonomy view does not support front-end search form or front-end sorting, you can edit your "taxonomy view", click "Screen Options", enable option "Custom Search Settings".

In section "Custom Search Settings", you should be able to see below message:
Only Views listing posts can have custom search inputs.

But you can try to setup some custom PHP codes to achieve what you want, for example, you can use Views filter hook "wpv_filter_taxonomy_query" to trigger a PHP function, in this function setup the custom filters, more help:

https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_taxonomy_query
When displaying a View listing taxonomy terms, this filter is applied to the arguments that will be passed to the get_terms() call.

https://developer.wordpress.org/reference/classes/wp_term_query/
Class used for querying terms.

#628301

I try to solve myself

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.