How to hide a div based on contents of custom field

Your third parameter of get_post_meta() is set to false. This means it will return an array. Even though you didn’t set a value for this custom field, it will still record an array element in the DB – so empty() will return false.

Try switching to true for your third param. That should return an empty string.

error code: 523