Title: Display image conditional statement
Last modified: August 21, 2016

---

# Display image conditional statement

 *  [jslom](https://wordpress.org/support/users/jslom/)
 * (@jslom)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/display-image-conditional-statement/)
 * Hello & thank you again for this wonderful plugin & support. Probably the best
   dev I have seen on here yet!
 * I placed some code in my bp-custom file, but I am not sure if it written properly..
   I modified some of your code posted elsewhere to get the results I needed. It
   works, although the next morning I logged into my cpanel and my CPU limits where
   going crazy…Just want to check and make sure this looks correct, because nothing
   else was changed prior to the many index.php processes running except this..
 * I want to display the image they have uploaded to the ‘Signature’ profile field,
   and if they have not uploaded one I want it to display the default one I have
   set.
 *     ```
       add_filter( 'bxcft_show_field_value', 'my_show_field', 15, 4);
       function my_show_field($value_to_return, $type, $id, $value) {
           if ($type == 'image') {
               if ($value != '') {
       				echo '';
               } else {
                   	return '<p><img src="http://ngx2gaming.com/wp-content/uploads/profiles/default_signature.png" /></p>';
               }
           }
           return $value_to_return;
       }
       ```
   
 * I am also running this code on the front end in a widget, that should do the 
   same thing, does this look ok?
 * `<?php //global $current_user; get_currentuserinfo(); echo xprofile_get_field_data("
   Signature" , $current_user->ID );?>`
 * Thank you!
 * [https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/](https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/)

The topic ‘Display image conditional statement’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/buddypress-xprofile-custom-fields-
   type.svg)
 * [Buddypress Xprofile Custom Fields Type](https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/)
 * [Active Topics](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [jslom](https://wordpress.org/support/users/jslom/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/display-image-conditional-statement/)
 * Status: not resolved