Skip Navigation

[Resolved] Use [wpv-post-type] to check results of a View in a loop

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

Problem:

Is there a way that I can use [wpv-post-type] with conditionals to check the results of a View in a loop and not the page the View is inserted on?

Solution:

Yes, it is possible to use shortcode [wpv-post-type] as condition of shortcode [wpv-conditional], see our document:

Relevant Documentation:

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

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

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Ben 5 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#1201434

Ben

Is there a way that I can use [wpv-post-type] with conditionals to check the results of a View in a loop and not the page the View is inserted on?

#1201558

Hello,

Yes, it is possible to use shortcode [wpv-post-type] as condition of shortcode [wpv-conditional], see our document:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-shortcodes-in-conditions/
there is an example code in section "Checking the type of the post displayed"

#1202548

Ben

All sorted now!

Thank you Luo Yang!