Skip Navigation

[Resolved] Sorting / Ordering for Views

This support ticket is created 5 years, 8 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.

This topic contains 3 replies, has 2 voices.

Last updated by Shane 5 years, 8 months ago.

Assigned support staff: Shane.

Author
Posts
#476285

I am trying to add a ordering / sortering button in my Archive Cell.

I visited this URL: https://toolset.com/forums/topic/sorting-views-output-by-custom-fields-date-and-more/

But since the questions is 3 years old, I guess there are some new solutions at this problem.

I would like to add a sorting button for post-title, post-date and date. Meaning a possibility to have DESC and ASC for each option.

This is the code I have found from the question above, but I can't get it to work.

<select name="wpv_column_sort_id">
<option value="post-title">Title</option>
<option value="post-date">Date</option>
</select>

Any ideas where I can find the code I am looking for?

#476569

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ole,

Thank you for contacting our support forum.

What you are referring to is a frontend sort that customer can select on the frontend how they want the data to be sorted correct?

Currently the only way to do this is by creating a view and displaying the data in a Table format and then enabling sortable columns on that table.

This way the table can be sorted by the headers.

Any other method would require that you write some custom code.

Thanks,
Shane

#477266

Hello Shane,

Thank you for helping me out,

I am referring to a frontend sort that customer can select on the frontend how they want the data to be sorted, that is correct.

The archive page is getting complicated and have used hours developing this part. So I would be happy if the problem could be solved by writing some custom code. Do you have any example of custom code that can be written?

My page can be found here if interested: hidden link

The page takes a long time to load, but I will open a separate question for that when time comes.

Looking forward to hear from you again,

#477451

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ole,

Unfortunately not.

You will need to write some custom code in order for this to work.

Our plugin doesn't have a way to perform frontend sorting.

Thanks,
Shane