Skip Navigation

[Resolved] How to filter by parents of 2 post relationsips

This support ticket is created 6 years 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Shane 6 years ago.

Assisted by: Shane.

Author
Posts
#1125303

I have:
Parent1 PostType
Parent2 PostType
Child PostType.

I want to filter view for Child PostType by both Parent post types.
Like:
show child which is belong only to both parent.

Which could be solved hierarchically - view filtered by Parent1 included view2 filtered by Parent2.

But! I also need to show Childs which is not belonged both to parent1 and parent2

Like:
[if post belonged to exact parent1id and exact parent2id] show something [/...]
[if post doesn't to exact parent1id and exact parent2id] show something different [/...]

For me best solution is filter one view by both parent ID but I don't see how to do it.

#1125538

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kiril,

Thank you for contacting our support forum.

You are trying to filter for both parents from the same CPT correct?

Please let me know.

Thanks,
Shane

#1125628

Hi Shane,

Yes, exactly. I found only how to filter it by one parent. But I need to filter it by both parents.

#1126353

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2018-10-12 at 9.10.58 AM.png

Hi Kiril,

See Screenshot.

When adding the filter for the post relationship, you should be able to choose the filter type. If you were to select Multiple then it should allow you to pick more than one parent on the frontend.

Please let me know if this helps.

Thanks,
Shane

#1126438
Screenshot 2018-10-12 17.39.24.png

Hi!
Actually this is not the issue.
So, your solution shows how to select several parents from the same type as filter for front end filtering of view.

Like show Post with ParentType1ID1 and ParentType1ID2

My issue:
- sort by parents id of parents of different post types. Like show posts with ParentType1ID1 and ParentType2ID2
- do it at backend by transfer parents ids by view parameter.

Both things not solved by your offered solution.

So, then I add one relationship as a filter, there is no option to add another.

#1126492

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kirill,

Unfortunately no, this does not seems to be possible with the multiple post types.

Thanks,
Shane

#1129166
#1129264

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kirill,

Thank you for opening this ticket.

I see where it has been assigned to the appropriate supporter and will be taken further from there,

Thanks,
Shane