WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Simple Fields] Images hide of none selected

[Resolved] [Plugin: Simple Fields] Images hide of none selected

  • Wondering if there is a way to hide the field if an image isn’t selected in the admin?

    calling an image like so:

    <?php $imgsrc = wp_get_attachment_image_src($getfields[“Image”][$count], ‘Image’); ?>

    <img src=”/wp/wp-content/themes/mytheme/phpThumb.php?src=<?=$imgsrc[0]?>&w=100&h=100&zc=1″ alt=”<?php echo($getfields[“Name”][$count])?>” title=”<?php echo($getfields[“Name”][$count])?>

    but if a user does not select an image in the admin, I want to have the whole <img> tag gone so there is nothing there… I am gettimg an empty img tag now… anyone?

    http://wordpress.org/extend/plugins/simple-fields/

Viewing 1 replies (of 1 total)
  • Plugin Author Pär Thernström

    @eskapism

    Can’y you just check if $imgsrc contains anything?

    Like
    if ($imgsrc) {
    // output image…

    or perhaps

    if (isset($imgsrc)) {
    // output image…

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Simple Fields] Images hide of none selected’ is closed to new replies.