Tell us what you are trying to do? I would like the CESA filter to sort ascending. Right now, it doesn't seem to recognize that 10 shouldn't come after 1 and before 2.
Hello. Thank you for contacting the Toolset support.
As I understand, you have added the post relationship filter to your view and now you want to display the post relationship filter select box value in ASC order. If this is correct :
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Ok - the thing is that the post is already order by post title and post title is a string. As post title treated as string the numbers in post title string will also be treated as string. As post title is a string itself.
Okay. I can think of 2 other ways we might accomplish this. The first is to sort by slug rather than title. That way we can add a zero in front of the single digit numbers in the slugs so they will sort properly. I tried this code (found in a Toolset support ticket) but it doesn't work. Are you able to help with this?
//Order search results by slug
add_filter('wpv_filter_query', 'post_ordered_by_slug', 99);
function post_ordered_by_slug( $query_args ){
$query_args ['orderby'] = 'name';
return $query_args;
}
If that won't work, the CESA information is also stored on the district as a custom field and maybe you could help me to use that as a filter rather than the CESA post type?
The thing is that you can only sort the post relationship filter based on the available options given with the filter when you add the filter: hidden link
There is no extremal way to filer the post relationship filter.
There is no workaround available as of now. It could be possible but then there is also possibility that it could break the core select 2 functionality and to offer support for such custom code is beyond the scope of our support policy.
If you need custom programming for your project, you're welcome to contact and get help from any of our certified partners:
=> https://toolset.com/contractors/