Skip Navigation

[Resolved] How do I set up conditional content based on if the view produces any content?

This support ticket is created 6 years, 5 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 1 reply, has 2 voices.

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

Assisted by: Luo Yang.

Author
Posts
#1103688
Screen Shot 2018-09-09 at 9.06.44 AM.png

Tell us what you are trying to do?

I'm building out a site for an architectural firm and setting up their 'portfolio' items with a parent relationship to the 'people' that worked on them so that their profile pages contain a resume section and the project titles can be clicked on to be taken to that project. I basically have it all set EXCEPT I'd like to be able to hide headers in the resume based on whether or not the filtered-by-taxonomy view I have set up produces any content on that particular page. For instance - if a 'person' hasn't worked on any 'portfolio' items with the taxonomy 'educational', then the header "Educational" would not appear. I'm attaching a screenshot so you can see the page layout and hopefully that helps clarify further. I have been playing around with the conditional content but can't figure out how to connect it with the view output or lack thereof. Is there any way to do this? Thanks, in advance, for your help.

What is the link to your site?

hidden link
(username: flywheel password: boothhansen)

#1104342

Hello,

I suggest you move the header text "Educational" into the view's loop section, for example, edit the view( ID 8038), in section "Loop Editor", within shortcode [wpv-items-found] ... [/wpv-items-found], display the text "Educational".

More help:
hidden link
Meta HTML wrapped in [wpv-items-found][/wpv-items-found] will be output if there are any posts | taxonomies | users returned by the View.