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.
What am I doing wrong?
Thank you for this question. Looki also for a solution for a while >> ACF True/False = Show/Hide Custom Post Type Condition
1.6 Beta 2 is live!
Very happy with the frequent updates! I hope they manage to fix the integration problem between Metabox, Loop and Conditions.
Not yet this time.
What Problem? I don’t get it.
If you want to hide a card when a dynamic text field is empty you need
to set the condition to your card. Not to your loop like you did in the video.
And the condition on the card would be like this:
So the card only shows if there is any content in the text field.
Yeah… I already tried to do exactly as you show, but for some reason it doesn’t work as it should.
See that the div that should be hidden is still displayed in the html.
I scoured the Facebook community and the Forum and found dozens of people facing the same issue.
I’m having a hard time believing this is user error.
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.
Ah now I got it. Thanks for your explanation. The html code was meant.
Basically you can solve this via your loop and without a condition. You need a meta loop for this.
Inside of your loop add the meta query with your condition:
Worked perfectly! Thank you very much!
Now I was still in doubt as to why the conditions didn’t work. Do you agree that there is a problem?
Usually when using a condition it should not exist in the source code.