Title: Conditional display
Last modified: August 30, 2016

---

# Conditional display

 *  Resolved [fabriciomanc](https://wordpress.org/support/users/fabriciomanc/)
 * (@fabriciomanc)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/conditional-display-6/)
 * How can I display a field conditionally ? (I mean, when It’s not blank, or null)
 * I tried using an if statement, but no luck. The FontAwesome icon appears anyway
   and the information didn’t because it doesn’t exist.
 *     ```
       <?php
       	if($user_info->adi_phone != '' || !empty($user_info->adi_phone) || $user_info->adi_phone != ' ') {
       		echo "<span><i class='fa fa-phone-square'></i>&nbsp;&nbsp;".$user_info->adi_phone."</span>";
       	}
       	if($user_info->adi_skype != '' || !empty($user_info->adi_skype) || $user_info->adi_skype != ' ') {
       		echo "<p><i class='fa fa-skype'></i>&nbsp;&nbsp;".$user_info->adi_skype."</p>";
       	}
       	?>
       ```
   
 * [https://wordpress.org/plugins/simple-user-listing/](https://wordpress.org/plugins/simple-user-listing/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/conditional-display-6/#post-6508716)
 * try `var_dump($user_info->adi_phone);` to see what the value is.
 *  Plugin Author [HelgaTheViking](https://wordpress.org/support/users/helgatheviking/)
 * (@helgatheviking)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/conditional-display-6/#post-6508757)
 * Both
 * `if($user_info->description)`
 * and
 * `if(!empty($user_info->description))`
 * seem to work for me.
 *  Thread Starter [fabriciomanc](https://wordpress.org/support/users/fabriciomanc/)
 * (@fabriciomanc)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/conditional-display-6/#post-6508831)
 * It worked now.. Some fields where filled with ” ” (two blank spaces)
    Just removed
   it 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Conditional display’ is closed to new replies.

 * ![](https://ps.w.org/simple-user-listing/assets/icon-256x256.png?rev=3061308)
 * [Simple User Listing](https://wordpress.org/plugins/simple-user-listing/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-user-listing/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-user-listing/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-user-listing/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-user-listing/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-user-listing/reviews/)

## Tags

 * [condition](https://wordpress.org/support/topic-tag/condition/)
 * [if](https://wordpress.org/support/topic-tag/if/)

 * 3 replies
 * 2 participants
 * Last reply from: [fabriciomanc](https://wordpress.org/support/users/fabriciomanc/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/conditional-display-6/#post-6508831)
 * Status: resolved