I am trying to sort view results using a M2M intermediary post field but it shows "No results found".
I need to sort the custom posts in the relationship "elenco" using a number as sorting priority.
If I change the sorting to Date, title, whatever, it works.
- The intermediary post is public (showui,publicly_queryable, etc).
- The custom field is a number one.
- Al posts have a number value.
Link to a page where the issue can be seen:
hidden link
Hello,
Views plugin is using wordpress class WP_Query to query the posts, so if you are ordering the result by custom field, then all posts should have the value in this custom field.
In your case, I suggest you setup a post view, query posts of the intermediary post type, order result by the intermediary post field, in the view's loop display the related(parent) post information:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-one-related-item-parent
Hi Luo,
Thats is what we done and it says "No results found".
Do you need some screenshot?
Please check these:
1) Make sure the custom number field is registered to the intermediary post type , all intermediary posts should have the value in this custom field
2) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/
Thanks for the details, I am downloading the file, will update here if there is anything found
As I mentioned above, this post view need to query the intermediary post type, I have done below modification in your website:
Edit the post view "Pelicula Elenco ficha":
hidden link
In section "CONTENT SELECTION" choose option "Elenco Intermediary Posts" instead of "Personas"
In section "Loop item in Pelicula Elenco ficha", you can use the field shortcode directly, for example:
[wpv-post-link item="@elenco.child"]
More help:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-one-related-item-parent
Great! Luo, many thanks for helping me. It was easy at the end.
Hi, Sorry for reopening, could you delete the images in the first post?
I tried but there isn't an option to do it.
Thanks!
As your request, those images are deleted.
My issue is resolved now. Thank you!