PHP Syntax Question
-
I posted on the author’s site, and I understand that he cannot respond to questions about PHP shortcode. But perhaps someone in the wider WordPress community would help me with this one:
The variable in
$phil_imgis the url to a GIF image. It works fine in url building, and populating<img ...>tags, etc… But I am trying to code in a conditional test:IF there is no GIF image, THEN I want to use a default “generic.gif”.
But I’m having trouble getting the syntax for conditionals that is parsed properly by the plugin.
Should the following work? (It does not.)
if(!file_exists($phil_img)) { return 'That is not a file.'; }Thanks for any pointers.
~Brendan
The topic ‘PHP Syntax Question’ is closed to new replies.