Home › Forums › Front-end Issues › If statement not working when field is empty › Reply To: If statement not working when field is empty
So, you are getting a value.
Likely causes
1) There is another field attached to the post with the same name
2) you are using conditional logic to hide the image field, the image field will still have a value even if it’s hidden. If you are using conditional logic then you need to do the if on that conditional field and not the image field.
3) get_the_ID() is returning the wrong post ID
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.