Skip Navigation

[Resolved] Conditional view based on logged in user = child post author and custom field =3

This support ticket is created 3 years, 2 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 3 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2194999

Tell us what you are trying to do?

Hi,

Parent post = job
Child post= application
custom field (radio) = interview

I would like to create a conditional view based on the logged in user being an author of "application" child post AND their child post having "interview" custom field = 3.

This conditional view will appear in the template of "job".

I have seen this elsewhere which might be close to what I am trying to achieve: https://toolset.com/forums/topic/conditional-output-based-on-child-post/

#2195727

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Do you mean you want to display the related application posts (child post) having "interview" custom field = 3 on the single post content template of parent post type jobs?

If this is correct, what if you:
- Create a view, set your view to query your child post type "applications' and add filter by related post of your post relationship:
=> https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items

Then add a query filter to filter the view by post author is equal to logged-in user:
=> https://toolset.com/documentation/user-guides/views/filtering-views-query-by-author/#post-author-is-the-same-as-the-logged-in-user

And then add another query filter for your custom field where value equal to 3.
=> https://toolset.com/documentation/user-guides/views/filtering-views-by-custom-fields/

Does this helps?