Skip Navigation

[Resolved] Trying to set conditional based on view

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

Problem:

I have a headline that I want to hide if there are no posts showing matching the view below it.

Solution:

I suggest you display the headline "Shop the Store" in the view shortcode [wpv-items-found]..[/wpv-items-found], for example:

Edit the view you mentioned above, in section "Loop Editor", add the headline "Shop the Store" just below shortcode [wpv-items-found].

Relevant Documentation:

http://wp-types.com/documentation/views-shortcodes/#wpv-items-found

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
- 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 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#920027

Hi

I have a headline that I want to hide if there are no posts showing matching the view below it. I cant seem to figure out how to do this. I tried using views shortcode but it did not work. On this page I have 2 views setup. The first view shows if a product matching the artist is in the store. If there is not a match I want to hide headline that says "Shop the Store"

The second is if the artist has a matching release. If not I want to hide the headline "Featured Releases"

Here are 2 examples:

hidden link
hidden link

Thanks

#920150

Hello,

I suggest you display the headline "Shop the Store" in the view shortcode [wpv-items-found]..[/wpv-items-found], for example:
Edit the view you mentioned above, in section "Loop Editor", add the headline "Shop the Store" just below shortcode [wpv-items-found].

See our document:
hidden link
Meta HTML wrapped in [wpv-items-found][/wpv-items-found] will be output if there are any posts |

#920360

Perfect! Thanks

#920618

You are welcome