Title: Logic issue
Last modified: August 21, 2016

---

# Logic issue

 *  [chrispink](https://wordpress.org/support/users/chrispink/)
 * (@chrispink)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/logic-issue/)
 * <? if (userphoto_the_author_photo() ) { ?>
 *  <? } ?>
 * …echoes the photo as an object and returns FALSE.
 * I would like to use my own code in this condition if it returns TRUE
 * how do I test (returning TRUE or FALSE) whether there is an author photo without
   returning the object?
 * [https://wordpress.org/plugins/user-photo/](https://wordpress.org/plugins/user-photo/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [chrispink](https://wordpress.org/support/users/chrispink/)
 * (@chrispink)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/logic-issue/#post-4847613)
 * Just to add this geezer has written some well dodgy code. AVOID!
 * This outputs the photo and returns FALSE
 *     ```
       <? if (!userphoto_the_author_photo() == "" ) { ?>
   
                <? echo "here" ; ?>
   
                <?  } ?>
       ```
   
 * and because life is too short to go off looking for other solutions and the backend
   does work.
 * this function;
 * `if (userphoto_exists(get_the_author_meta( 'ID' )) )`
 * I found in the plugin does the trick (note the necessary parameter).
 * so the whole code;
 *     ```
       if (userphoto_exists(get_the_author_meta( 'ID' )) ) {
            get_avatar(get_the_author_meta( 'ID' ));
       }
       ```
   
 * outputs the author photo (if one exists) and nothing (no gravatar) if not.

Viewing 1 replies (of 1 total)

The topic ‘Logic issue’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/user-photo.svg)
 * [User Photo](https://wordpress.org/plugins/user-photo/)
 * [Support Threads](https://wordpress.org/support/plugin/user-photo/)
 * [Active Topics](https://wordpress.org/support/plugin/user-photo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-photo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-photo/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [chrispink](https://wordpress.org/support/users/chrispink/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/logic-issue/#post-4847613)
 * Status: not resolved