Skip Navigation

[Résolu] Conditional display based on post-id

This support ticket is created Il y a 1 an et 8 mois. 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 3 réponses, has 2 voix.

Last updated by Shane Il y a 1 an et 8 mois.

Assigned support staff: Shane.

Auteur
Publications
#1832201

I have an existing site which uses Views shortcodes.
Within a content template, is it possible to make the display of some text dependent upon a specific post-id? I mean using the wpv-conditional shortcode?
Regards
Robert

#1832375

Shane
Supporter

Languages: Anglais (English )

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

Hi Rober,

Thank you for getting in touch.

Yes you can using our wpv-conditional shortcode to check the post's ID.

Thanks,
Shane

#1832399

Hi Shane
Could you assist with an example shortcode please. For example, if the post-id is 356, then what would the wpv-conditional code line be?

So that the field would be displayed if the post-id was 356?

Regards
Robert

#1832457

Shane
Supporter

Languages: Anglais (English )

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

Hi Robert,

Here is an example

[wpv-conditional if="('[wpv-post-id]' eq '356')"] 
Do this
[/wpv-conditional]

Thanks,
Shane