Skip Navigation

[Resolved] Sorting months search field

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

Problem:
The user has a custom taxonomy that has months as terms. Inside a view's taxonomy filter, he would like to display them in months order and spread them in two columns

Solution:
Toolset does not offer a way to sort taxonomy terms in a filter. Use a third-party plugin to enforce your custom taxonomy order. Examples:

To spread the filter checkboxes across two columns use Custom CSS. Check the example in https://toolset.com/forums/topic/sorting-months-search-field/#post-2105591

This support ticket is created 3 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
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: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by nadavL 3 years, 11 months ago.

Assisted by: Jamal.

Author
Posts
#2102005
Screenshot 2021-06-29 114912.jpg

Hi,
I have a Taxonomy called Time of Year, which includes a list of months and seasons.

How can I define the field data order, when I add it to a View Search option? (see attached image)

In addition, is it possible to present the data in two columns?

Thanks,
Nadav

#2102301

Hello Nadav, and thank you for contacting Toolset support.

Toolset does not offer a way to order the terms in a taxonomy filter, but you can use a 3rd party plugin to do that. Check one of these plugins:
- https://wordpress.org/plugins/custom-taxonomy-order-ne/
- https://wordpress.org/plugins/simple-taxonomy-ordering/
- https://wordpress.org/plugins/wp-term-order/

Regarding your second question, it is not possible to have a multi-select input in two columns. That is how HTML multi-select fields appear. On the other hand, you can use checkboxes display, and those can be spread across multiple columns, using custom CSS code. Check this online thread https://stackoverflow.com/questions/20027595/grouping-checkboxes-css-in-multiple-column-layout

I hope this helps. Let me know if you have any questions.

#2103223

Thanks,

The plugin works perfectly.

About setting two columns, I'll try to take a closer look at the thread you send. It's not that clear at the moment.
Anyway, I didn't understand where should I put the code. In the "View" top level?

#2104725

I didn't understand where should I put the code. In the "View" top-level?
This depends on how you are building the view. Using the blocks editor(Gutenberg) or using the legacy editor. Check these screenshots:
- The blocks editor: hidden link
- The legacy editor: hidden link

If you get stuck about having two columns for the filter(as checkboxes), allow me temporary access to your website and I'll try to help. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
I'll need to know what view and where it is being displayed.

#2105591

For the "Tours & Sightseeing", I, first, added a class to the filter in the advanced section. Check this screenshot hidden link
This will help me scope the custom CSS to only the filters that have this CSS class.

Then I added the following code to the view's CSS section. Check this screenshot hidden link

.two-cols .wpv-custom-search-filter__input {
    column-count: 2;
}

I did the same thing for the "Trip Planner" page too. Basically, adding the class to the filters, then adding the custom CSS to the view's CSS section.

I did this for two filters "Time Of Year" and "Age Groups". If you want to disable this for the "Age Groups" filter, just remove the CSS class from its advanced settings section.

All the best,
Jamal

#2105593

My issue is resolved now. Thank you!