Skip Navigation

[Résolu] Adding a « sort by alpha » option to random results in custom post type view

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem: I would like to display a View initially sorted in random order. I would like to provide a checkbox on the filters so Users can sort the results alphabetically by title.

Solution: Nothing exactly like that exists in Toolset, but there are other options available for front-end sorting.

Relevant Documentation: https://toolset.com/documentation/user-guides/allowing-visitors-to-sort-the-front-end-results/

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.

This topic contains 2 réponses, has 2 voix.

Last updated by Tom Gonzales Il y a 1 an et 11 mois.

Assigned support staff: Christian Cox.

Auteur
Publications
#1310655

Tell us what you are trying to do?
I would like to add the option (using a checkbox) for the user to sort the view results, which load in random order by default, to sort by title ascending after the initial view results have loaded.
Is there any documentation that you are following?
No
Is there a similar example that we can see?
No
What is the link to your site?
hidden link

#1310691

Christian Cox
Supporter

Languages: Anglais (English )

Timezone: America/New_York (GMT-04:00)

Screen Shot 2019-08-06 at 3.20.56 PM.png

Hi Toolset doesn't have this exact type of control available, but does allow for front-end sorting of a View's results by the User by other means. The checkbox isn't available, but you can show a dropdown list of sort options and allow Users to adjust the sort direction if you'd like. To insert those controls, edit the View and find the Search and Pagination editor panel. If you cannot find the panel, scroll to the top right corner and click "Screen Options". You can enable the Search and Pagination editor panel here. Click "Sorting Options" to see a popup that allows you to edit the front-end sorting options. I'm attaching a screenshot here showing options for random order and order by title. A preview is included on the right side.

Another option is to create a sortable table View. More detailed information about these features is available in the documentation here: https://toolset.com/documentation/user-guides/allowing-visitors-to-sort-the-front-end-results/

Let me know if that's not clear, and I can help.

#1310707

My issue is resolved now. Thank you!