The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 8 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<h4>[wpv-taxonomy-title]</h4> ----> (I want to not display this is nothing in the child view for this item)
[wpv-view name="My Child View"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
Currently, it still shows the parent wpv-taxonomy-title even when the child view is empty.
example:
PARENT
child
child
child
PARENT - I want childless parents not to show in the list
PARENT
child
I would like to have it not display if there isn't anything in the child view - but don't know how to reference it using an "evaluate" statement. I've tried checking if the pdf-or-image-file field is empty, but that doesn't work because it doesn't know to look in the child view.
I had tried the [wpv-taxonomy-post-count] shortcode but it still didn't work. What eventually did work after much trial and error and research was registering the following in my functions.php.
Unfortunately, since I updated Views & Types today to the newest releases and then WordPress to 4.3, this no longer works and I no longer get anything displayed. (If I remove the [wpv-if], it works - so it is just the check against the child view that isn't working.) I tried the method above again using [wpv-taxonomy-post-count] , but it still displays the childless parents.
BTW - When I try to see the Views 1.10 release notes, I get a blank page. Please help!
The nested short codes might be a problem with WordPress 4.3. I will suggest to use the following code, this is the same [clean-view] short code of yours, but with a slight modification:
Please notice the view name passed as the parameter to short code and render_view() function used in the short code function. Please read more about render_view() at https://toolset.com/documentation/user-guides/views-api/. Also remember to register [clean-view] in views settings.
I had help with this several months ago, but now the plugin has changed and this solution no longer works. I have tried changing my code to the following, but still am getting empty child views displayed.