Empty Custom Field Returning as Not Empty?
-
I have the following code to check if a custom field is not empty. If it is not empty it builds the sidebar menu. Works fine if the current page HAS values, but when ‘recommend’ has not been used on a page it still spits out the H2 heading and ul wrapper. Why would this be returning a value? When I echo it, it spits out ‘Array’ with nothing in position [0]
This same if statement is used through my theme without issues…
[Code moderated as per the Forum Rules. Please use the pastebin]
Any suggestions?
The topic ‘Empty Custom Field Returning as Not Empty?’ is closed to new replies.