I have a problem with the sort function om my site: hidden link
I have a bootstrap grid with a list of affiliate product. I try to sort the list after the fields: "popularitet", "minrente" and "minaop" but when I make a sort, the list is sorted after post_date. When I try to enable the debug mode under tools/settinge I can see the result in the screenshot i have attach in the jpg file.
somehow the orderby change from "popularite"t to "post_date" between "Filter arguments before the query using wpv_filter_query" and "Filter the returned query using wpv_filter_query_post_process". What ame I doing wrong?
These custom fields you are using, e.g. popularitet, are they Types custom fields or do they come from another plugin?
I created a quick test with a Restaurant custom post type and a Rating custom field.
I used the Loop Wizard to auto-generate the output using a sortable table, and it worked as expected.
Stripping away all of the extraneous markup (the output is generated as a <table>) leaves me with this:
[wpv-items-found]
<!-- wpv-loop-start -->
[wpv-heading name="post-title"]Post title[/wpv-heading]
[wpv-heading name="post-date"]Post date[/wpv-heading]
[wpv-heading name="types-field-rating"]Rating[/wpv-heading]
<wpv-loop>
[wpv-post-body view_template="Loop item in List restaurants with ratings"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
Note the format for [wpv-heading] when using a Types custom field.
In further testing I tried adding non-Types custom fields using the Loop Wizard and it left the name argument blank. Sorting results in Views is only supported for Types custom fields, and not for custom fields which come from 3rd party plugins.