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
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.
My issue is resolved now. Thank you!