Title: [Plugin: Widget Logic] Display widget for specific user only
Last modified: August 19, 2016

---

# [Plugin: Widget Logic] Display widget for specific user only

 *  Resolved [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * (@vanderwijk)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-widget-logic-display-widget-for-specific-user-only/)
 * I am trying to have a widget displayed for a specific user but unfortunately 
   I cannot get it to work.
 * I have found out how to get the current user id and display a text for this user
   only, but I don’t know how to convert to Widget Logic code.
 * This is what I am trying to do:
 *     ```
       <?php
       $user_id = get_current_user_id();
       if ($user_id == 3) {
           echo 'Show Widget.';
       }
       ?>
       ```
   
 * Can anyone tell me how I can get the above to work with Widget Logic?

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

 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-widget-logic-display-widget-for-specific-user-only/#post-1640653)
 * i haven’t checked it, but at a guess
 * get_current_user_id()==3
 * might work
 *  Thread Starter [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * (@vanderwijk)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-widget-logic-display-widget-for-specific-user-only/#post-1640877)
 * Thanks for your help, it works!

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

The topic ‘[Plugin: Widget Logic] Display widget for specific user only’ is closed
to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-widget-logic-display-widget-for-specific-user-only/#post-1640877)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
