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

  • bmc1416

    (@bmc1416)


    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)
  • Plugin Author elliotcondon

    (@elliotcondon)

    have you tried to debug the variable?
    Use the var_dump function to see what the value is

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