I have a Custom Field called "Lyrics". I am trying to create a condition where for a post if the Lyrics field is blank then the text <h3>Lyrics</h3> will not display.
I have the code set like this, but it is just hiding the Lyrics header regardless of whether there is anything contained in the Custom Field:
I'm guessing that the "eq" above maybe stands for "equals" in which case I understand why there is an issue. How do I make the above code say "if wpcf-lyrics CONTAINS ANYTHING then output blah blah blah.
Thanks for the reply. For some reason this is still not working for me. If I use the conditional then the <h3>Lyrics</h3> disappears regardless of whether there is content in the custom field.
I am attaching a couple screenshots of my layout and the output that I am getting.
In the sceenshot of the page above the words "Do you know my name?" should be the Lyrics header. "Do you know my name" is the content of the "lyrics" custom field. That page can be seen here: hidden link
One secondary question-when I export the custom fields in a CSV, those fileds are lableled with an prefix. IE, the field is: cf_wpcf-lyrics instead of wpcf-lyrics. I have tried both in this conditional with no difference in the output.
From the screenshots, condition looks fine and should work as expected.
1. Please delete all sort of caches in your site plugin cache (WP Fastest Cache), CDN / server cache (if any), browser cache too.
2. If still issue persists, please provide temporary website WP-admin and FTP info for your site so I can debug further. Your next answer will be private which means only you and I have access to it.
=== Please backup your database and website ===
✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.
✙ Please add the Links to the [Layout] edit screen where we can see condition and the issue.
I have checked the condition in your layout, you were using dot “.” in the condition instead of empty quotation marks. I have updated the condition (see attached screenshot) and it is working as expected.
Thanks so much for fixing the issue. However I am confused, as you can see from my above screenshot that I didn't have "." on the screen shot there. I did try to search for a period in a much earlier attempt. This is the second time I have reached out to support where it has seemed like I have made a change only to find that the change (perhaps also?) needed to happen somewhere else. This is even after I cleared the cache.
So is there somewhere else besides looking there in the layout->Edit Layout where I should have checked for the change? I'd like to not have to keep bothering you guys with issues if I should be looking somewhere other than where I am looking or if perhaps the edits get propagated somewhere else that I should be checking. Thanks.
There were some special characters when I opened the visual editor cell, that’s why dot was not displaying in screenshot. I just re-added the condition and it works. This is the only change I have done.