Skip Navigation

[Resolved] Sort books by a custom field containing author's last name

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

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: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 5 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1244894

Thanks for your response,
I also need to Sort books by a custom field containing author's last name (and then sort books' titles alphabetically - using nested View) . How is that possible?
This author's last name is coming from another custom post type which is related to woo commerce product using Toolset relations. Let me know if it is clear to you?

#1244897

I assume we are talking about this case:
1) Two post types
- Authors(with custom field "last name")
- Books

2) One-to-many relationship between above post types Authors and Books.

If it is, it is possible with a nested view, for example, you can try these:
1) Parent post view "Author lists"
- query Author posts
- order by field "last name"
- in view's loop, display below child post view

2) Child post view "Related book posts"
- query Book posts
- order by post's title
- filter by the post type relationship between Authors and Books.
- in view's loop, display below book post information

More help:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items