If I put the condition on the same element with loop, it doesn’t work. If I put the condition on the card, and the loop on the parent div, it also doesn’t work as I would like.
The condition should hide the card if a text field is empty.
The problem is that the loop div should be hidden, and as the condition is applied on the child div (card), the parent div (loop) continues to be displayed in the html.
When I apply the condition on the same element the loop is in, everything works perfectly! But it only works with native WordPress fields. Does not work with Metabox fields.