WordPress.org

Ready to get started?Download WordPress

Forums

Shortcode Exec PHP
PHP Syntax Question (1 post)

  1. doclalor
    Member
    Posted 1 year ago #

    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_img is 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

    http://wordpress.org/extend/plugins/shortcode-exec-php/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by doclalor
  • This topic is not a support question
  • WordPress version: 3.5.2