Skip Navigation

[Resolved] Parent conditional statement

This support ticket is created 6 years, 3 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 6 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#608744

***Tell us what you are trying to do?***
I have a CPT called Inscription and the Inscription is child of 3 other types of CPT (atelier-et-rite, formation, voyage).
I start creating a view for displaying those events <a href="hidden link"> here </a>

I want to link the post title to the parent and not the current post.
I use this shortcode that display it correctly for one CPT

 <a href="[wpv-post-url id='$atelier-et-rite']">[types field='titre-court-de-l-evenement'][/types]

I repeat it 3 times, one for each of those, but it prints 3 title.

Now, I try to find the perfect conditional code saying
IF parent post type of current post = name of the custom post type
display title and link

I haven't found this condition and I need help with it.
Thank you.

What is the link to your site?
hidden link

#608776

Dear Louis,

Please elaborate the question with more details:
IF parent post type of current post = name of the custom post type
display title and link

If you are going to compare the post title of current child post with post title of parent "atelier-et-rite" post, you can try with [wpv-conditional] shortcode like this:

[wpv-conditional if="( '[wpv-post-tite id='$atelier-et-rite']' eq '[wpv-post-tite]' )"]
display title and link
[/wpv-conditional]

More help:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-shortcodes-in-conditions/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.