Skip Navigation

[Resolved] View Sorting on front end shows option not provided

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

Our next available supporter will start replying to tickets in about 0.55 hours from now. Thank you for your understanding.

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+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by gordonW-2 2 years, 6 months ago.

Assisted by: Jamal.

Author
Posts
#2172375
Screen Shot 2021-09-17 at 2.30.36 PM.png

I have a view that has sorting options enabled ... I have two options available Sort by Name and Sort by Location. However when the page loads, a third option appears "Post date" ... which I do not have as one of the options (see screenshot)

page: hidden link

also, since for whatever reason we CANNOT add a sort by Taxonomy value ... I created a Checkboxes Field to duplicate that behavior ... however that ASLO is NOT an option for me to select.

Can checkboxes fields not be used for sorting? I am able to surface that value in the Toolset Heading Block (see underneath each project's location)

thx

Gordon

#2172801

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello Gordon and thank you for contacting Toolset support.

Well, WordPress does not offer a way to sort queries using a taxonomy. In fact, Toolset just uses the WP_Query interface https://developer.wordpress.org/reference/classes/wp_query/

Toolset checkboxes fields are saved as a serialized array, so, it cannot be possible to sort with it using the WP_Query. I don't think it can be possible at all(from an SQL perspective).

However, regarding the post date sorting option, you can remove it using Javascript code. Add the following snippet to the view's Javascript section:

jQuery(function($){
    $('.wpv-sort-control-select>option[value=post_date]').remove();
})

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

#2179087

My issue is resolved now. Thank you!

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