Support » Plugin: Advanced Custom Fields » If get_field Equals False

  • I’m trying to replace an image with a gravatar if the image in the custom field returns false(or does not exisit)

    So I’ve set my variable

    <?php $thumb_image = get_field('thumb_image'); ?>

    What is the value if there is no image in the custom field thumb_image? This is not working

    <?php if ($thumb_image == false) : ?>
     <?php echo get_avatar( get_the_author_meta('ID') ); ?>
    <?php endif; ?>

    http://wordpress.org/extend/plugins/advanced-custom-fields/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘If get_field Equals False’ is closed to new replies.