Skip Navigation

[Resolved] wpv-post-id in wpv-conditional

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display parent post taxonomy value using [wpv-conditional] shortcode

Solution:
With Types 3.X.X version, you should use item attribute in order to fetch the parent value.

For example:

[wpv-conditional if="( '[wpv-post-taxonomy type="film-category" format="slug" item="@film-esemeny.parent"]' eq 'abc' )"]
 condition is true
[/wpv-conditional]

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/wpv-post-id-in-wpv-conditional/#post-919718

Relevant Documentation:

This support ticket is created 6 years, 6 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)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by laszloB 6 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#919556

Hi

This code is working for me:

film category: [wpv-post-taxonomy type="film-category" format="slug" id="[wpv-post-id item='@film-esemeny.parent']"]

Working too:

[wpv-conditional if="('[wpv-post-taxonomy type="film-category" format="slug" id="1234"]' eq 'abc' )"] film category: abc [/wpv-conditional]

But this is not working:

[wpv-conditional if="('[wpv-post-taxonomy type="film-category" format="slug" id="[wpv-post-id item='@film-esemeny.parent']"]' eq 'abc' )"] film category: abc [/wpv-conditional]

Any idea?

#919718

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - I just tried the following code and it works for me:

Could you please try following code and check if that help you to resolve your issue. With Types 3.X.X version, you should use item attribute.

[wpv-conditional if="( '[wpv-post-taxonomy type="film-category" format="slug" item="@film-esemeny.parent"]' eq 'abc' )"]

condition is true

[/wpv-conditional]
#919984

Thank you! It works...