CPTs: "Centers" and "Units" with a many to many relationship
Custom Taxonomy: "Specialty"
"Specialty" is a taxonomy for both "Centers" and "Units".
Some Centers have Units, but others don´t.
This is part of the template for "Center":
Center A
Specialty 1
-- Unit 1
-- Unit 2
-- Unit 3
Specialty 2
-- Unit 4
-- Unit 5
Specialty 3
--Unit 6
This part´s output is shown through this view ("Specialties in a Center"):
<wpv-loop>
[wpv-post-body view_template="loop-item-in-specialties-in-a-center"] <!-- Shows the Specialty -->
[wpv-view name="units-in-a-hospital-per-specialty"] <!-- Shows the Units that have that Specialty-->
</wpv-loop>
It filters by taxonomy term defined by the current post.
The view loops the specialties of the Center, and then the Units that belong to each specialty.
If there is a Hospital that has no Units, then its specialties are shown with nothing below.
What I want is to show this area only for Centers that have Units. If there are no Units, the Specialty should not be shown.
Unfortunately no there isn't a way to do this. The main issue here is because we are not able to evaluate a view in a conditional tag in order to display a specific text.
Perhaps this can be done using some amount of custom code but defaultly it isn't possible to do.
Happy that you were able to resolve the issue. If there are any further issues I will be more than happy to assist. If not then you can go ahead and closed here.