I am using the following to code for two custom fields. When an image is inserted, there is no box underneath. If a video is inserted, a blank image/block shows up beneath it. There should be nothing. Im only inserting one or the other. I am pretty sure I am missing the echo part for the image if it is true, but I have tried several things with no luck. Any help is appreciated. I have included a screen shot as well…
Thank you. I figured the image is the problem, but I am not sure how to get it to display true only if it is true. If its not, it does nothing. The video is working properly.
I’m a little confused so bare with me here, from what i can gather you have two custom fields in which only one can be displayed at a time?
If that’s right then a question i have for you would be what would you like to happen if both fields have a value in it?
I ask because the logic wonshikee used is doing exactly what you need it to do so why not just set a variable to say if “video” is present and “image” is present ignore “image”.
After rereading it, I have determined that you are correct and that I am an idiot. … With that out the way, I am getting a unexpected T_ELSE when I change the “if”
to “else if”