Skip Navigation

[Resolved] Order a view by parent posts field AND filter by intermediary post field

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

This topic contains 2 replies, has 1 voice.

Last updated by guyH 5 years, 9 months ago.

Author
Posts
#1233083
Screen Shot 2019-04-18 at 10.45.00 PM.png

Tell us what you are trying to do? I have 'Attorney' post type and 'Practice Area' post type in a M2M relationship, with intermediary post custom fields. I want to order(sort) the view by the 'Attorney Title' field in the 'Attorney' posts, and filter the view by the 'Experience level' custom field in the intermediary posts.
I know how to do the sort by itself and the filter by itself, but how to do both on the same view?
It seems that to filter by a field in the intermediary post, I have to set the Content Selection to the intermediary post type and then access the Attorney(parent) post fields via the 'item' attribute. But then I'm stuck on how to sort the view by the 'Attorney Title' field in the parent(Attorney) posts.

Is there any documentation that you are following? Searched support forums with no luck.

Is there a similar example that we can see?

What is the link to your site? hidden link

#1233090

*** removed. Didn't know this was public

#1233138

My issue is resolved now. Thank you!
I went with a different solution for this case: Creating a second relationship between the same 2 PTs allowed me to achieve the result I need.