Navigation überspringen

[Gelöst] Conditional display based on post-id

This support ticket is created vor 4 years, 10 months. 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 -

Zeitzone des Unterstützers: America/Jamaica (GMT-05:00)

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Shane vor 4 years, 10 months.

Assistiert von: Shane.

Author
Artikel
#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
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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