you enter into "Name of Shul" input field the words "boca raton", you will see 2 posts come up. 1 will have child posts inside, and the other one will be empty. (Note that an empty child post will have the words "No shiurim at this location. Add one here" inside of the parent post. This is the generic statement I have displaying for empty Locations).
==>
To fix this issue I've adjusted the code added to "Custom Code" section with code snippet "Only Display Shiur Location with Shiur" and change the following line of code from:
if(empty($parent_ids) or empty($has_role) ){
To
if(empty($parent_ids) or empty($has_role) or empty($found_loc_shiur)){
Another search example is the word "aish" again into the same input field. You will see 4 posts show up. The first 3 are good, they have child posts inside, the last one is empty and should be hidden according to our script.
==>
To fix this issue, this is not the issue form the code I've added but the conditionals you added within the view's loop. I've adjusted the following condition from the following view from:
- hidden link
[wpv-conditional if="( $(wpcf-contact-role).item(@person-to-shiur.parent) eq 'Maggid Shiur' )"]
To:
[wpv-conditional if="( '[types field='contact-role' option='1' item='@person-to-shiur.parent'][/types]' eq 'Maggid Shiur' )"]
This change is required because as you can see with the following post, it has been assigned with the three "Contact Role" checkboxes option (Rabbi, Maggid Shiur, Contact)
- hidden link
The following condition is mean to check only one checkbox option checked out of all but you have checked three options n (Rabbi, Maggid Shiur, Contact):
[wpv-conditional if="( $(wpcf-contact-role).item(@person-to-shiur.parent) eq 'Maggid Shiur' )"]
So, to check specific option out of all checked, we have to change the conditional statement to:
[wpv-conditional if="( '[types field='contact-role' option='1' item='@person-to-shiur.parent'][/types]' eq 'Maggid Shiur' )"]
More info:
- https://toolset.com/documentation/customizing-sites-using-php/functions/#checkboxes
I must say the structure you have is really hard to understand as well as really complex one but happy that every time I found the solution for you and glad that I can assist you with the solutions.